Re: Deploy modifications of database objects

From: Dan Smith <j(dot)daniel(dot)smith1(at)gmail(dot)com>
To: Mai Peng <maily(dot)peng(at)webedia-group(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Deploy modifications of database objects
Date: 2021-06-22 15:31:33
Message-ID: CAK50Jrzv2Xwy4E089xbWc0uBhhdR5zLJ3fXj0MvTN0wzBdXX+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)peng(at)webedia-group(dot)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
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Wells Oliver 2021-06-23 19:20:49 Optimizing materialize views for refresh
Previous Message Jayson Hreczuck 2021-06-22 13:28:33 Re: Deploy modifications of database objects