Thread: pg_dump issues

pg_dump issues

From
"Rod Taylor"
Date:
Could we add a flag to remove the postgres specific information from a
pg_dump?

--
UPDATE "pg_class" SET "reltriggers" = 0 WHERE "relname" ~*
'market_type';

BEGIN TRANSACTION;

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" ~*
'market_type' 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;

--

These make importing into other database systems rather difficult.

--
Rod Taylor

There are always four sides to every story: your side, their side, the
truth, and what really happened.

Re: pg_dump issues

From
Philip Warner
Date:
At 14:48 24/01/01 -0500, Rod Taylor wrote:
>Could we add a flag to remove the postgres specific information from a
>pg_dump?

It's easy enough to do, but removing all PG-specific information is
probably undesirable since, eg, pg_dump does not dump foreign key
constraints in a standard way (it just dumps the rules). pg_dump also
issues '\connect' statements, and will dump user-defined types, rules and
functions that will probably not conform to the SQL standard.

Over time I would like to see the output of pg_dump become as standard as
possible - but in the mean time, would people see any value in a flag to do
any of the following:

(a) disable modifications to system tables (eg. turning off triggers and
constraints) 

(b) just disable code which turns off the triggers? Or something else...

(c) something else....


I can actually see value in (b) since people may want to load a single
table *and* have triggers operating.


----------------------------------------------------------------
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   |/