Re: [PATCHES] system catalog relation of a table and a

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Brent Verner <brent(at)rcfile(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Rod Taylor <rbt(at)zort(dot)ca>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] system catalog relation of a table and a
Date: 2001-12-17 22:02:40
Message-ID: Pine.LNX.4.30.0112172218210.642-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Brent Verner writes:

> | The more general question is: Should 'pg_dump -t table' dump all objects
> | that "table" depends on? Keep in mind that this could mean you have to
> | dump the entire database (think foreign keys). In my mind, dumping an
> | arbitrary subset of dependencies is not a proper solution, though.
>
> Do you care to share your ideas on what a proper solution /would/ be?

Either all dependencies or no dependencies would be a "proper" solution,
in my mind. Which one we should use is not obvious, that's why I stated
that question.

When you think about it, dumping the dependencies turns out to be less
useful than it seems at first. Since any object can be a dependency for
more than one object it would not work in general to do

pg_dump -t table1 > out1
pg_dump -t table2 > out2

psql -f out1
psql -f out2

unless you mess with CREATE OR REPLACE, which we don't have for all
objects and which would probably not be possible to execute in all
situations.

So the only real use for "dump object X and all dependencies" would be to
extract a functional subset of one database into another. But that seems
to be a lot less common operation.

Therefore I think that we should go with "no dependencies" (which is also
a lot easier, no doubt).

(Whether we should consider serial columns to be a dependency or an
integral part is a different question.)

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-12-17 22:03:05 Re: Explicit config patch 7.2B4, not "-C" ??
Previous Message Don Baccus 2001-12-17 22:02:08 Re: PG 7.2b4 bug?

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2001-12-18 00:05:13 Re: [HACKERS] Problem compiling postgres sql --with-tcl
Previous Message Brent Verner 2001-12-17 14:48:58 Re: [PATCHES] system catalog relation of a table and a serial sequence