Re: pg_dump issues

Lists: pgsql-hackers
From: "Rod Taylor" <rod(dot)taylor(at)inquent(dot)com>
To: "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_dump issues
Date: 2001-01-24 19:48:35
Message-ID: 05e401c0863e$a377ddd0$2205010a@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.

Attachment Content-Type Size
Taylor, Rod B.vcf text/x-vcard 451 bytes

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: "Rod Taylor" <rod(dot)taylor(at)inquent(dot)com>, "Hackers List" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump issues
Date: 2001-01-26 03:09:05
Message-ID: 3.0.5.32.20010126140905.02f6d930@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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