It recently came to my attention that pg_dump dumps 'CREATE SEQUENCE' and
'SELECT NEXTVAL' commands for both data-only and schema-only output. This
results in problems for users who do the two in separate steps, and seems a
little odd.
Also, I'd be interested to know what the purpose of 'SELECT NEXTVAL' is?
My inclinations is do do the following:
- Issue 'CREATE SEQUENCE...Initial Value 1...' in OID order
- Issue 'SELECT SETVAL...' at end of data load.
This means that a schema-only restore will hgave all sequences set up with
initial value = 1, and a data-only restore will have sequences set
'correctly'.
Does this sound reasonable?
----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \| | --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/