From: John R Pierce <pierce@hogranch.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #13941: Different value "pg_constraint.consrc" for similar Check Constrait
Date: Wed, 10 Feb 2016 17:46:13 -0800
Message-ID: <56BBE7E5.7070106@hogranch.com> (raw)
In-Reply-To: <CAKFQuwa8F-biku9w4a=Vr__y3F_7zYQgTSJ=DQV9aeD_3VP89Q@mail.gmail.com>
References: <20160210105328.24150.99473@wrigleys.postgresql.org>
<20160210164736.dag57bvnjqou24fm@alap3.anarazel.de>
<CAKFQuwZbVi0VXJOEtEj2y5J9Ote+nO=jNr5ttMxM21tUC90tpw@mail.gmail.com>
<CAKFQuwY=TA3zaBsJv01qkrUpEnH_9iYawt=JfQp-CdyaxOj2cA@mail.gmail.com>
<1455145106.62139926.6fmxb1r4@frv32.fwdcdn.com>
<CAKFQuwa8F-biku9w4a=Vr__y3F_7zYQgTSJ=DQV9aeD_3VP89Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2/10/2016 5:36 PM, David G. Johnston wrote:
> There is a process:
> In the empty base creates the necessary data structure.
> Then, based on the contents of the tables "pg_catalog" obtain and
> maintain the description of this structure (snapshot).
> In the future, comparing the (snapshot) with another (snapshot)
> received from the production database, a decision about the difference
> between the structures and the need to transform the production database.
>
> The essence of the problem :
> Developer creates check constrait according to [1] describe the bug.
> In reference (snapshot)to store the result of [1] describe the bug.
> The production database is missing the check constraint and the
> decision of its creation.
> Add instruction is generated from the reference (snapshot)and
> corresponds to [2] describe the bug.
> After this addition, we obtain check constraitwhich is functionally
> equivalent to the reference, but differs from the description of the
> reference.
> And this in turn causes a re-creation check constraitfor each of the
> subsequent verification of the production database structure.
we follow a decidedly different and IMHO simpler process.
1) data base designer creates a .SQL file that generates schema version
1. this is checked into source code control along with the application
components, and is used to initialize a new database.
2) database designer/developer creates a delta .SQL file that will
update X to X+1, and a .SQL file that will create X+1 from scratch.
these are both checked into source code control.
production either runs the delta update file, or the current full schema
file as appropriate. we keep a row in our 'settings table with
setting='schema_version', value='X' (for version X), so automated
installation scripts can apply the correct updates in order.
this process lets us update 'static data' as well as schema structure
(for some databases, the static data has its own versioning, and
seperate set of .sql scripts)
--
john r pierce, recycling bits in santa cruz
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: pierce@hogranch.com
Subject: Re: BUG #13941: Different value "pg_constraint.consrc" for similar Check Constrait
In-Reply-To: <56BBE7E5.7070106@hogranch.com>
References: <20160210105328.24150.99473@wrigleys.postgresql.org> <20160210164736.dag57bvnjqou24fm@alap3.anarazel.de> <CAKFQuwZbVi0VXJOEtEj2y5J9Ote+nO=jNr5ttMxM21tUC90tpw@mail.gmail.com> <CAKFQuwY=TA3zaBsJv01qkrUpEnH_9iYawt=JfQp-CdyaxOj2cA@mail.gmail.com> <1455145106.62139926.6fmxb1r4@frv32.fwdcdn.com> <CAKFQuwa8F-biku9w4a=Vr__y3F_7zYQgTSJ=DQV9aeD_3VP89Q@mail.gmail.com> <56BBE7E5.7070106@hogranch.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox