如何仅启用Google Cloud Postgresql log_statements仅对一个数据库角色?
我想仅查询登录一个特定角色。但是,似乎不可能用 cloudsqlsuperuser
角色的角色打开
postgres=> ALTER ROLE my_log_role SET log_statement = 'all';
ERROR: permission denied to set parameter "log_statement"
它对于整个实例,可以通过云SQL工具可用,但是可以在托管的PostgreSQL中为选择角色而不是全部来完成此操作吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只有超级用户才能更改此设置。 ()
检查Cloudsqlsuperuser是否是运行“ show is_superuser;”的超级用户;
超级用户限制
https://cloud.google.com/sql/sql/docs/postgres/postgres/postgres/postgres/users# superuser_restrictions
Only superusers can change this setting. (https://www.postgresql.org/docs/9.5/runtime-config-logging.html#GUC-LOG-STATEMENT)
check if cloudsqlsuperuser is a superusers running "show is_superuser;"
Superuser restrictions
https://cloud.google.com/sql/docs/postgres/users#superuser_restrictions
由于PostgreSQL的Cloud SQL是一项托管服务,因此“未提供访问,运行以下命令是必需的:
但是,
,您可以考虑在Google Compertute上托管PostgreSQL (gce)实例,您将拥有完全控制。
As Cloud SQL for PostgreSQL is a managed service, the "
superuser
" access is not provided, which is required to run the below command:However,
If this is a blocker, you may consider hosting PostgreSQL on a Google Compute Engine (GCE) instance, where you will have full control.
我能够通过首先运行以下命令来使其适用于我的AWS Aurora PostgreSQL实例:
然后我能够运行Alter cole命令
i was able to get this to work for my aws aurora postgresql instance by running the following command first:
then i was able to run the alter role command