Search code examples
postgresqlgoogle-cloud-platformlogginggoogle-cloud-sql

In Google Cloud SQL Postgres how do I avoid log_min_messages as not superuser?


There's no way in google cloud sql postgres to make a superuser. So I get:

psql --version
psql (PostgreSQL) 16.3 (Postgres.app)
psql postgres://postgres:password@ip/db
FATAL: permission denied to set parameter "log_min_messages"

when I try and connect. I've set this flag to "info" but still when I connect it tries and change the value and this error is fatal. Without making a superuser how can I get around this?

  • "Superuser restrictions and privileges Cloud SQL for PostgreSQL is a managed service, so it restricts access to certain system procedures and tables that require advanced privileges. In Cloud SQL, customers cannot create or have access to users with superuser attributes."

https://cloud.google.com/sql/docs/postgres/users


Solution

  • I did

    brew install postgresql@15
    

    and that somehow fixed it for me. Even though I'm still using my original psql (PostgreSQL) 16.3 (Postgres.app). I can now login without that FATAL error but no idea why this fixed it.