Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-07 Thread Guido Neitzer
On 06.02.2008, at 19:41, Andrej Ricnik-Bay wrote: And a more generic version :} Thanks for that! I had solved my problem as I saw that actually importing all database from the dump file was faster than compressing the dump file (on a 4 core Woodcrest). So it wasn't that big of a deal that

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-06 Thread Andrej Ricnik-Bay
On 05/02/2008, Scott Marlowe <[EMAIL PROTECTED]> wrote: And a more generic version :} 8<8<8<8<8<8<8<8< #!/bin/bash # split.sh: a shell script and wrapper for some (g)awk to extract a single #database out of a dump

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Andrej Ricnik-Bay
Or, for the heck of it: sed -n -e '/DATABASE smarlowe/p' -e '141,334p' test.sql > clean.sql ;} Cheers, Andrej -- Please don't top post, and don't use HTML e-Mail :} Make your quotes concise. http://www.american.edu/econ/notes/htmlmail.htm ---(end of broadcast)

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
Nice... Can this be reliably put into a script? The script would take only the DB name as parameter. And one gotcha I woud look out for is to see the CREATE DB's template= is nothing but template0, else warn the user that the DB may not be reliably restored. Best regards, On Feb 4, 2008 6:03 PM,

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Scott Marlowe
On Feb 4, 2008 7:10 PM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > On 04.02.2008, at 18:00, Gurjeet Singh wrote: > > > I understand it all needs a little bit of 'vi' wizardry, (or > > whichever editor you are using). Also, as with all open-source > > suggestions, do not rely on this procedure until

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
Well... I assumed that'd be the case; production dumps are not small... this calls for some scripting stuff; the script should basically the steps mentioned above, and you will have a trimmed down version of the dump file... :) But again, the script should be fast enough to make this additional st

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Guido Neitzer
On 04.02.2008, at 18:00, Gurjeet Singh wrote: I understand it all needs a little bit of 'vi' wizardry, (or whichever editor you are using). Also, as with all open-source suggestions, do not rely on this procedure until you understand what and how it does what it does. Sure, the only probl

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
I understand it all needs a little bit of 'vi' wizardry, (or whichever editor you are using). Also, as with all open-source suggestions, do not rely on this procedure until you understand what and how it does what it does. Best regards, On Feb 4, 2008 4:39 PM, Gurjeet Singh <[EMAIL PROTECTED]> wr

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
Sorry couldn't respond earlier... Yeah, there's no -f option to pg_dumpall, I confused it with pg_dump's -F option. Since the output of dumpall is plain SQL, since and you would use psql to restore the DB, there's no command line option to execute only a part of the script. Long story short: you

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Guido Neitzer
On 04.02.2008, at 10:41, Gurjeet Singh wrote: What was the output format option used (-f option) ? Was it the plain-text (SQL) or custom format? I cannot see a -f option on pg_dumpall. This is the command: pg_dumpall > `date "+%y-%m-%d"`.sql I just want to use an older file from a dump to r

Re: [GENERAL] Reload only specific databases from pg_dumpall

2008-02-04 Thread Gurjeet Singh
What was the output format option used (-f option) ? Was it the plain-text (SQL) or custom format? Best regards On Feb 4, 2008 2:45 AM, Guido Neitzer <[EMAIL PROTECTED]> wrote: > Hi. > > Is it possible to reload only specific databases from a file created > by pg_dumpall? > > Thanks, > cug > > -