From: Jesus Sandoval <meli@mzt.megared.net.mx>
To: David F. Skoll <dfs@roaringpenguin.com>
Cc: jesus@merkatek.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Database maintenance help
Date: Sun, 15 Dec 2002 01:14:39 +0000
Message-ID: <3DFBD77F.43CA3333@mzt.megared.net.mx> (raw)
References: <3DFA3D06.9080308@unboundtech.com>
<28985.1039812229@sss.pgh.pa.us>
<3DFA8828.629086@mzt.megared.net.mx>
<Pine.LNX.4.50.0212140853350.1643-100000@shishi.roaringpenguin.com>
"David F. Skoll" escribió:
> On Sat, 14 Dec 2002, Jesus Sandoval wrote:
>
> > following:
> > 1) Backup the database data, pg_dump is of no use because if the table design
> > changed then the COPY table FROM stdin produced by pg_dump needs to be
> > modified to accomodate the space for the new columns.
>
> Actually, you can use pg_dump with some special options. I handle schema
> changes like this:
>
> 1) Back up the database with a normal pg_dump, just in case.
> 2) Back it up again with pg_dump "-a -D" -- This produces a bunch of
> INSERT INTO... statements
> 3) Drop the database
> 4) Recreate the database with the new schema
> 5) Restore from the dump in step (2). As long as all columns in the old
> schema are still present in the new schema, it works. If you need to
> get rid of a column, then in step (4), create a database with the unneeded
> column, and then do a step (6) whereby you drop unneeded columns.
>
> The only problem is that restoring from (2) is slow; so I use a script to
> add a "BEGIN...COMMIT" wrapper around the dump to speed it up.
>
> --
> David.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Ok, thanks
I had no clue about where to begin with this. I'll try it.
btw, thanks for your contributions to the open source comunity, I'm actually using
the ppp with my ADSL Modem, and found your ssh presentation very interesting, I'm
using it to reach an internal net from a ISP provider (practical magic with ssh).
Jesus Sandoval
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-admin@postgresql.org
Cc: meli@mzt.megared.net.mx, dfs@roaringpenguin.com, jesus@merkatek.com
Subject: Re: Database maintenance help
In-Reply-To: <3DFBD77F.43CA3333@mzt.megared.net.mx>
References: <3DFA3D06.9080308@unboundtech.com> <28985.1039812229@sss.pgh.pa.us> <3DFA8828.629086@mzt.megared.net.mx> <Pine.LNX.4.50.0212140853350.1643-100000@shishi.roaringpenguin.com> <3DFBD77F.43CA3333@mzt.megared.net.mx>
* 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