Re: Advice request : simultaneous function/data updates on many databases - Mailing list pgsql-general

From David G. Johnston
Subject Re: Advice request : simultaneous function/data updates on many databases
Date
Msg-id CAKFQuwZG=d5SgEwbFa2o84mgM-wAUrnoJJrZaX+TF-zJG9zMNA@mail.gmail.com
Whole thread Raw
In response to Advice request : simultaneous function/data updates on many databases  (Rory Campbell-Lange <rory@campbell-lange.net>)
List pgsql-general
On Wed, Mar 4, 2020 at 3:04 PM Rory Campbell-Lange <rory@campbell-lange.net> wrote:
However, for larger updates, the time when the front end code is
out-of-step with the database can cause end-user problems.

You should try very hard to structure your database migrations so that instead of going directly from uniquely valid state to another uniquely valid state you instead transition to a dual-ly valid state (i.e., don't break the old way of doing things while adding the pieces to make the new way of doing things work) and then separately remove the old valid state components once you know all of the software upgrades have been deployed.

Add New Stuff, Leave Old Stuff Alone
Remove Old Stuff

Triggers can be installed during the transition period to facilitate the duplication of data that will result.

This should be considerably easier for non-data impacting updates as you can just choose different names for the new stuff then remove the old stuff separately.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Advice request : simultaneous function/data updates on manydatabases
Next
From: Rory Campbell-Lange
Date:
Subject: Re: Advice request : simultaneous function/data updates on manydatabases