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

编程入门 行业动态 更新时间:2024-10-20 06:41:20
本文介绍了无法在 Google Cloud SQL 上创建 postgis 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 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: cloud.google/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 扩展

本文发布于:2023-10-13 10:11:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1487662.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Cloud   Google   postgis   SQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!