Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 17C1A2E00C7 for ; Sun, 27 Jan 2008 11:23:06 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 74444-02 for ; Sun, 27 Jan 2008 11:22:54 -0400 (AST) Received: from web56405.mail.re3.yahoo.com (web56405.mail.re3.yahoo.com [216.252.111.84]) by postgresql.org (Postfix) with SMTP id 6ABE02E00AC for ; Sun, 27 Jan 2008 11:23:00 -0400 (AST) Received: (qmail 84037 invoked by uid 60001); 27 Jan 2008 15:22:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=Pc8U988OcFdAk8Nyku2tHYeHz9c2ArYdQUul/bM3KBzdzMAc0wMtaIZ6mA6KcugekJ9XvQehDb7jtxZ36j0eHcWbZ+BYxDNgiXwN/4D2FzI0yPSmVPeRYnjZrBCNsYu+SlPquNUXsQJai006bj3Rb2e7x4pfndevWb/wKRMihpw=; X-YMail-OSG: EbSNMUkVM1nKhu998afIKIWKyV2hIteT4Zru5q_E1iBNUQkLDO4C2zBqRjVVlzxV0T9jEchWiBWceW5HkWK7xWvrYhZk0YRPPdhV8VjiQeftD1NgT9CayPBgDICJHg-- Received: from [70.22.77.195] by web56405.mail.re3.yahoo.com via HTTP; Sun, 27 Jan 2008 07:22:58 PST Date: Sun, 27 Jan 2008 07:22:58 -0800 (PST) From: NUWAN LIYANAGE Subject: Re: backup including symbolic links? To: Scott Marlowe Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-381333013-1201447378=:83189" Content-Transfer-Encoding: 8bit Message-ID: <658738.83189.qm@web56405.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/262 X-Sequence-Number: 28036 --0-381333013-1201447378=:83189 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thank you very much Scott.. I'll keep you updated on my progress. Thanks again. Nuwan. Scott Marlowe wrote: On Jan 26, 2008 3:06 PM, NUWAN LIYANAGE wrote: > Yes, I was thinking of doing a pg_dumpall, but my only worry was that the > singl file is going to be pretty large. I guess I don't have to worry too > much about that. > But my question to you sir is, If I want to create the development db using > this pg dump file, how do I actually edit create tablespace statements so > they will be created in the directory I want them to be. Or should I even > worry about this.. (I want my data directory to be in E: drive including all > the tablespaces.) Take a look through the docs on pg_dump and pg_dumpall. A few of the options to look at are the ones to dump just data or just schema. Quite often you don't need the data, just the schema, for development. "pg_dump -s dbname" will dump just the schema, and "pg_dumpall --globals" will dump just the global database info, i.e. usernames, tablespaces, etc... Then just edit in your favorite text editor and point the resulting file(s) at your dev db with psql f mydump.sql where mydump.sql is the file you got from one or more of the above operations. After that, I highly recommend that any changes you wish to make, do so with .sql scripts (stored in your favorite version control system), so that you can then apply them to your production database later with minimal fuss. Note that any changes that should be "all or nothing" to the production database can be applied in a transaction (i.e. wrapped in a begin/commit pair) and then either all or none of the changes will be made... example begin; create table abc .... alter table xyz ... insert ... commit; if any of those commands fail (things like creating unique indexes might fail on production where they didn't in development) then no harm, no foul, just figure out what went wrong and update your script so it takes care of those problems. --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search. --0-381333013-1201447378=:83189 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Thank you very much Scott..
I'll keep you updated on my progress.
Thanks again.
Nuwan.

Scott Marlowe <scott.marlowe@gmail.com> wrote:
On Jan 26, 2008 3:06 PM, NUWAN LIYANAGE wrote:
> Yes, I was thinking of doing a pg_dumpall, but my only worry was that the
> singl file is going to be pretty large. I guess I don't have to worry too
> much about that.
> But my question to you sir is, If I want to create the development db using
> this pg dump file, how do I actually edit create tablespace statements so
> they will be created in the directory I want them to be. Or should I even
> worry about this.. (I want my data directory to be in E: drive including all
> the tablespaces.)

Take a look through the docs on pg_dump and pg_dumpall.

A few of the options to look at are the ones to dump just data or just
schema. Quite often you don't need the data, just the schema, for
development. "pg_dump -s dbname" will dump just the schema, and
"pg_dumpall --globals" will dump just the global database info, i.e.
usernames, tablespaces, etc...

Then just edit in your favorite text editor and point the resulting
file(s) at your dev db with psql f mydump.sql where mydump.sql is the
file you got from one or more of the above operations.

After that, I highly recommend that any changes you wish to make, do
so with .sql scripts (stored in your favorite version control system),
so that you can then apply them to your production database later with
minimal fuss.

Note that any changes that should be "all or nothing" to the
production database can be applied in a transaction (i.e. wrapped in a
begin/commit pair) and then either all or none of the changes will be
made...

example
begin;
create table abc ....
alter table xyz ...
insert ...
commit;

if any of those commands fail (things like creating unique indexes
might fail on production where they didn't in development) then no
harm, no foul, just figure out what went wrong and update your script
so it takes care of those problems.


Looking for last minute shopping deals? Find them fast with Yahoo! Search. --0-381333013-1201447378=:83189--