Skip site navigation (1) Skip section navigation (2)

Re: backup including symbolic links?

From: NUWAN LIYANAGE <alnuwan(at)yahoo(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: backup including symbolic links?
Date: 2008-01-27 15:22:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Thank you very much Scott.. 
I'll keep you updated on my progress.
Thanks again.

Scott Marlowe <scott(dot)marlowe(at)gmail(dot)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

create table abc ....
alter table xyz ...
insert ...

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.

In response to

pgsql-admin by date

Next:From: Mark StebenDate: 2008-01-28 17:21:34
Subject: production error
Previous:From: paul riversDate: 2008-01-26 22:49:20
Subject: Re: Syslog to postgresql - need peaks of 5.000/s

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group