Closed t83714 closed 3 years ago
~We should upgrade cloudSQL proxy default version to 1.26.0
~.
~Test shows it's more stable than 1.11
when connect to Cloud SQL remotely (outside google cloud) with unstable network~
above was not true for some case
Steps for CloudSQL (using using Google's DMS):
Please note: Google DMS won't be able to handle everything --- see FAQ
cloudsql.logical_decoding
and cloudsql.enable_pglogical
flags to on
and restart ALTER TABLE webhookevents ADD PRIMARY KEY (eventtypeid, webhookid);
to add primary keyCREATE EXTENSION IF NOT EXISTS pglogical;
(this statement needs to be run on every databases)ALTER USER postgres with REPLICATION;
gcloud config set project [project id]
gcloud sql connect [instance name] --user=postgres --quiet
client
(with same password) and assign privileges in all Magda DBs by:create user client with encrypted password '[password]';
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO client;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO client;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO client;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE, SELECT ON SEQUENCES TO client;
After grant permission to client
user, you can login db as client
user to verify you can see all tables.
Wait till replication delay reach zero, then:
SELECT last_value FROM events_eventid_seq;
SELECT eventid from events order by eventid DESC limit 1;
SELECT setval('events_eventid_seq', xxxx);
Then:
AWS RDS Upgrade can be simply done by modify RDS instance and choose a new version. More info: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html#USER_UpgradeDBInstance.PostgreSQL.MajorVersion
tested v1.0.0-alpha.5 in dev cluster with both cloudSQL and RDS ---- all worked well
@steve9164 this is the GCP postgreSQL upgrade instruction we talked the other day
Test Google CloudSQL & AWS RDS PostgreSQL Migration Process with v1