无法在 Google Cloud SQL 上创建 postgis 扩展 [英] Can't create postgis extension on Google Cloud SQL
问题描述
我有一个 Postgres 数据库和我在 Google Cloud SQL 上创建的用户.
我正在尝试为该用户安装 postgis 扩展:
myuser=>创建扩展postgis;错误:创建扩展postgis"的权限被拒绝提示:必须是超级用户才能创建此扩展.
如你所见,它不允许我为这个用户创建扩展,所以我试图让这个用户成为 postgres
角色的超级用户:
postgres=>使用超级用户更改用户 myuser;错误:必须是超级用户才能更改超级用户
我收到以下错误.这是因为 Google Cloud SQL 不允许任何 postgres 帐户的 SUPERUSER
角色根据:
I've got a Postgres database and user I've created on Google Cloud SQL.
I'm trying to install the postgis extension for that user:
myuser=> CREATE EXTENSION postgis;
ERROR: permission denied to create extension "postgis"
HINT: Must be superuser to create this extension.
as you can see, it won't allow me to create the extension for this user, so I attempted to make this user a superuser from the postgres
role:
postgres=> ALTER USER myuser WITH SUPERUSER;
ERROR: must be superuser to alter superusers
and I get the following error. This is because Google Cloud SQL does not allow the SUPERUSER
role for any postgres accounts according to: https://cloud.google.com/sql/docs/postgres/users.
So I'm in this weird state of purgatory that I need to add this extension, but can't.
Any tips on how to proceed?
It looks like creating a new user through the API (or the console) will give it the proper permissions, at least according to the prompt when trying to add additional users through the console:
这篇关于无法在 Google Cloud SQL 上创建 postgis 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!