Re: Deploy modifications of database objects - Mailing list pgsql-admin

From Dan Smith
Subject Re: Deploy modifications of database objects
Date
Msg-id CAK50Jrzv2Xwy4E089xbWc0uBhhdR5zLJ3fXj0MvTN0wzBdXX+w@mail.gmail.com
Whole thread Raw
In response to Deploy modifications of database objects  (Mai Peng <maily.peng@webedia-group.com>)
List pgsql-admin
Where ever possible, I would recommend you use a version control system (git) for DDL history and create a process to run migration / rollback scripts.  Setting up a QA / Staging system and some tests would also probably raise your confidence level in the code / performance.

If this is to support versioned API's, I would probably spend my time ensuring the abstraction was correct for functions (limited to doing just one thing) and that future changes were backwards compatible (seconding what Jayson said).  Adding features or refactoring generally shouldn't break the contract.

Assuming you wanted to have some beta users or feature flags in production, I would probably use a schema or obvious new object name prefix or suffix (probably with a date).  In this instance, I would probably lean toward the application using the correct object where necessary for feature flag (manage feature flag from one location where possible).  From there I would be diligent to clean up un-used versions when versions were made GA.


Best regards,

Dan Smith



On Tue, Jun 22, 2021, 06:00 Mai Peng <maily.peng@webedia-group.com> wrote:
Hello everyone,

We often deploy modified function code to production database. In order to impact the less users that still use the old version of these functions, we add another function. I think it’s not relevant.
How could we deploy these modifications ? Add a schema per version ?
Thank you in advance.
Mai

pgsql-admin by date:

Previous
From: Jayson Hreczuck
Date:
Subject: Re: Deploy modifications of database objects
Next
From: Wells Oliver
Date:
Subject: Optimizing materialize views for refresh