Hi all,

Came across a scenario today where I want to backup the latest values of 
sequences in the database, so they can be restored along with the data 
from a COPY command.

Looked at pg_dump's output options (for 7.4/7.5) and there doesn't seem 
to be an easy way for just dumping sequence definitions (with the latest 
sequence numbers).

Thought about using egrep too, but had difficulties there too.

Does anyone else think it would be a useful thing adding an option to 
pg_dump for outputting just the sequences?

Or perhaps there's an easy way of doing this I just haven't thought of?

:-)

Regards and best wishes,

Justin Clift


Fri, 16 Jul 2004 13:52:21 +1000
Justin Clift <jc@telstra.net>
pg_dump - option for just dumping sequences?
> Does anyone else think it would be a useful thing adding an option to 
> pg_dump for outputting just the sequences?
> 
> Or perhaps there's an easy way of doing this I just haven't thought of?

Can't you just grep the output for pg_catalog.setval and SET SESSION 
AUTHORIZATION?

Chris


Fri, 16 Jul 2004 12:58:30 +0800
Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Re: pg_dump - option for just dumping sequences?
Christopher Kings-Lynne wrote:
>> Does anyone else think it would be a useful thing adding an option to 
>> pg_dump for outputting just the sequences?
>>
>> Or perhaps there's an easy way of doing this I just haven't thought of?
> 
> Can't you just grep the output for pg_catalog.setval and SET SESSION 
> AUTHORIZATION?

Arrrgh, yep.

Thanks Chris, I must be in space cadet mode today.  :(

Regards and best wishes,

Justin Clift


> Chris




Fri, 16 Jul 2004 15:14:38 +1000
Justin Clift <jc@telstra.net>
Re: pg_dump - option for just dumping sequences?