Re: pg_dump output - Mailing list pgsql-hackers

From Kovacs Zoltan
Subject Re: pg_dump output
Date
Msg-id Pine.LNX.4.21.0102122221290.11244-100000@pc10.radnoti-szeged.sulinet.hu
Whole thread Raw
In response to Re: pg_dump output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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
 



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump output
Next
From: Dave Page
Date:
Subject: RE: [ODBC] RE: [PATCHES] Fix for ODBC close