By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,178 Members | 971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,178 IT Pros & Developers. It's quick & easy.

pg_dump incorrect sequence value

P: n/a
Hi,

I had dumped data using the command:

pg_dump -U dbowner dbname -a -t table -f table-data.sql

two tables (e.g. table1, table2).

In the first table - the correct sequence was set as can
be seen at the end of the dump file:

.....
SELECT pg_catalog.setval ('table1_id_seq', 20, true);

but in the second table - the sequence was incorrect:

....
SELECT pg_catalog.setval ('table2_id_seq', 1, true);

Question:
How do I correct this so that dumping data sets the
correct sequence value?

Using:
Red Hat 8
Linux 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 GNU/Linux

postgresql-libs-7.3.3-1PGDG
postgresql-tcl-7.3.3-1PGDG
postgresql-server-7.3.3-1PGDG
postgresql-7.3.3-1PGDG
postgresql-libs-7.2.2-1
postgresql-contrib-7.3.3-1PGDG

TIA,

Joshua

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Joshua L. San Juan" <jo**********@q-linux.com> writes:
but in the second table - the sequence was incorrect:
SELECT pg_catalog.setval ('table2_id_seq', 1, true);


It seems fairly hard to believe that what pg_dump emitted was not the
actual state of the sequence object. Why do you think this is incorrect?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.