Score:1

Upgrade GCP hosted PostgreSQL while keeping existing user passwords

ru flag

I have been tasked with upgrading our GCP hosted PostgreSQL databases from version 9.6 to version 13.

The instructions I found (https://cloud.google.com/sql/docs/postgres/upgrade-db) say that we need to create a new database and then "Make sure the target instance has... The same user accounts, with the same PostgreSQL privileges and passwords"

We have a number of databases with dozens of users and roles, we allow users to connect directly and set their own passwords. We would like to perform the database upgrade without changing all the passwords.

I've looked at using pg_dumpall to copy the users to a new database, but it fails as I don't have permission to read pg_authid. It seems that we need a superuser account to be able to read pg_authid, and GCP does not permit superuser accounts.

Is there any way to upgrade the databases and keep the existing passwords?

Score:0
ru flag

It seems that there wasn't a way to do this at the time I asked the question, but things have moved on since then.

Google Cloud SQL now provides in-place major version upgrades, which will keep the existing user passwords.

https://cloud.google.com/sql/docs/postgres/upgrade-major-db-version-inplace

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.