By the way, I get each sequence twice in pg_dump output... In psql:
CREATE TABLE x (y SERIAL);
Then running pg_dump with switches -xacnOD, I get:
--
-- Selected TOC Entries:
--
DROP SEQUENCE x_y_seq;
DROP SEQUENCE x_y_seq;
--
-- TOC Entry ID 1 (OID 2625010)
--
-- Name: x_y_seq Type: SEQUENCE Owner: postgres
--
CREATE SEQUENCE x_y_seq start 1 increment 1 maxvalue 2147483647 minvalue 1
cache 1 ;
--
-- TOC Entry ID 3 (OID 2625010)
--
-- Name: x_y_seq Type: SEQUENCE Owner: postgres
--
CREATE SEQUENCE x_y_seq start 1 increment 1 maxvalue 2147483647 minvalue 1
cache 1 ;
--
-- Data for TOC Entry ID 5 (OID 2625029) TABLE DATA x
--
\connect - postgres
-- Disable triggers
UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" ~* 'x';
-- Enable triggers
CREATE TEMP TABLE "tr" ("tmp_relname" name, "tmp_reltriggers" smallint);
INSERT INTO "tr" SELECT C."relname", count(T."oid") FROM "pg_class" C,
"pg_trigger" T WHERE C."oid" = T."tgrelid" AND C."relname" ~* 'x' GROUP
BY 1;
UPDATE "pg_class" SET "reltriggers" = TMP."tmp_reltriggers" FROM "tr" TMP
WHERE
"pg_class"."relname" = TMP."tmp_relname";
DROP TABLE "tr";
COMMIT TRANSACTION;
--
-- TOC Entry ID 2 (OID 2625010)
--
-- Name: x_y_seq Type: SEQUENCE SET Owner:
--
SELECT setval ('x_y_seq', 1, 'f');
--
-- TOC Entry ID 4 (OID 2625010)
--
-- Name: x_y_seq Type: SEQUENCE SET Owner:
--
SELECT setval ('x_y_seq', 1, 'f');
-------------------------------------------------------------------------
Is this correct?
Zoltan
-- Kov\'acs, Zolt\'an kovacsz@pc10.radnoti-szeged.sulinet.hu
http://www.math.u-szeged.hu/~kovzol ftp://pc10.radnoti-szeged.sulinet.hu/home/kovacsz