Re: Constraint->function dependency and dump in 7.3

Re: Constraint->function dependency and dump in 7.3

am 13.07.2004 20:03:37 von pg

On Tue, 2004-07-13 at 13:42, SZÛCS Gábor wrote:
> Dear Rod,
>
> Thanks. It'll be a pain to have two versions between the prod and devel
> servers, but I'll forward this info to the chief.

You can make this part easier on yourself.

Dump the structure from production and migrate it to devel (fix the dump
file). Keep this file.

>From now on when applying changes to production, keep the structural
changes applied as a separate SQL file (numbers work well).

When building a new box to duplicate production:
1. Apply all patches in order
for i in `ls *.sql` ; do cat $i | psql test_db ; done
2. Do a data dump of production and restore that to the testing area
pg_dump --data-only prod_db | psql test_db

Now you don't need to worry about whether the production schema will or
will not dump properly, since you can reproduce that using external
files.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Re: Constraint->function dependency and dump in 7.3

am 13.07.2004 20:20:24 von surrano

Dear Rod,

That sounds as good as simple ;) As for as patching, we do something like
that. Developed a PHP script that compares schema files (not dumps, but
source codes instead) to the actual. Say, it creates a temp table and
compares it to the existing one, examining pg_attributes, pg_indexes,
pg_constraints etc. then runs appropriate ALTER TABLE commands on the old
table. Creating a clean double of the prod and keeping its schema sounds
good to handle exceptional things.

Yours,
G.
%----------------------- cut here -----------------------%
\end

----- Original Message -----
From: "Rod Taylor"
Sent: Tuesday, July 13, 2004 8:03 PM


> When building a new box to duplicate production:
> 1. Apply all patches in order
> for i in `ls *.sql` ; do cat $i | psql test_db ; done
> 2. Do a data dump of production and restore that to the testing area
> pg_dump --data-only prod_db | psql test_db
>
> Now you don't need to worry about whether the production schema will or
> will not dump properly, since you can reproduce that using external
> files.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)