无法在Google Cloud SQL上创建Postgis扩展

时间:2019-04-26 16:11:51

标签: postgresql google-cloud-platform google-cloud-sql

我有一个Postgres数据库和一个我在Google Cloud SQL上创建的用户。

我正在尝试为该用户安装postgis扩展名:

myuser=> CREATE EXTENSION postgis;
ERROR:  permission denied to create extension "postgis"
HINT:  Must be superuser to create this extension.

如您所见,它不允许我为此用户创建扩展名,因此我尝试从postgres角色中将该用户成为超级用户:

postgres=> ALTER USER myuser WITH SUPERUSER;
ERROR:  must be superuser to alter superusers

,出现以下错误。这是因为Google Cloud SQL不允许https://cloud.google.com/sql/docs/postgres/users的任何Postgres帐户使用SUPERUSER角色。

所以我处于炼狱的怪异状态,需要添加此扩展名,但是不能。

有关如何进行操作的任何提示?

1 个答案:

答案 0 :(得分:1)

至少通过尝试通过控制台添加其他用户时,根据提示,似乎通过API(或控制台)创建新用户将为其赋予适当的权限:

enter image description here