How do I create a user with the superuser role in Postgres server with Google Cloud console?
When I create databases in Google Cloud, the default user is a non-superuser. From this role, it is not possible to upgrade.
How do I create a user with the superuser role in Postgres server with Google Cloud console?
When I create databases in Google Cloud, the default user is a non-superuser. From this role, it is not possible to upgrade.
no way:
https://cloud.google.com/sql/docs/postgres/users
The postgres user is part of the
cloudsqlsuperuser
role, and has the following attributes (privileges): CREATEROLE, CREATEDB, and LOGIN. It does not have theSUPERUSER
orREPLICATION
attributes.
Here's my own script:
GRANT cloudsqlimportexport, cloudsqlsuperuser, pg_read_all_data, pg_write_all_data, postgres TO myawsumuser WITH ADMIN OPTION;
GRANT ALL PRIVILEGES ON DATABASE mytestdb1 TO myawsumuser WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON DATABASE postgres TO myawsumuser WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO myawsumuser with grant option;
GRANT USAGE ON SCHEMA public TO myawsumuser with grant option;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO myawsumuser with admin option;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO myawsumuser with grant option;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO myawsumuser with grant option;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON SEQUENCES TO myawsumuser with grant option;
Good links: https://cloud.google.com/sql/docs/postgres/users
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO myawsumuser with admin option;
in pg 14 –
Resnick © 2022 - 2025 — McMap. All rights reserved.