Postgres: grant yourself superuser privileges
- Initiate your proxy connection to the SQL database instance.
- Log in as postgres (Credentials are in 1Password)
psql -h 127.0.0.1 -p 55435 -u postgres -d postgres
- Look at the database permissions table with
\du . You need to have:
- Create database,
- Create role attributes
- and cloudsqlsuperuser role

- If you do not have those permissions, give them to yourself with these commands (Notice!!! we need to check this for creating user need to be check using playbook or something else !!!):
- Note: Be absolute sure that you get the group and username in the GRANT query in correct order, otherwise you will break the
cloudsqlsuperuser group.
begin;
ALTER USER "first.lastname@aholadigital.com" CREATEDB;
ALTER USER "firstname.lastname@aholadigital.com" CREATEROLE;
GRANT cloudsqlsuperuser TO "first.lastname@aholadigital.com";