pgsql-server/src/bin/pg_dump common.c pg_dump. ...

From: momjian(at)postgresql(dot)org (Bruce Momjian - CVS)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql-server/src/bin/pg_dump common.c pg_dump. ...
Date: 2002-10-09 16:20:25
Message-ID: 20021009162025.DD3044768C4@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian(at)postgresql(dot)org 02/10/09 12:20:25

Modified files:
src/bin/pg_dump: common.c pg_dump.c pg_dump.h

Log message:
> Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> > I'm looking at pg_dump/common.c:flagInhAttrs() and suspect that it can
> > be more or less rewritten completely, and probably should to get rigth
> > all the cases mentioned in the past attisinherited discussion. Is this
> > desirable for 7.3? It can probably be hacked around and the rewrite
> > kept for 7.4, but I think it will be much simpler after the rewrite.
>
> If it's a bug then it's fair game to fix in 7.3. But keep in mind that
> pg_dump has to behave at least somewhat sanely when called against older
> servers ... will your rewrite behave reasonably if the server does not
> offer attinhcount values?

Nah. I don't think it's worth it: I had forgotten that older versions
should be supported. I just left the code as is and added a
version-specific test.

This patch allows pg_dump to dump correctly local definition of columns.
In particular,

CREATE TABLE p1 (f1 int, f2 int);
CREATE TABLE p2 (f1 int);
CREATE TABLE c () INHERITS (p1, p2);
ALTER TABLE ONLY p1 DROP COLUMN f1;
CREATE TABLE p3 (f1 int);
CREATE TABLE c2 (f1 int) INHERITS (p3);

Will be dumped as
CREATE TABLE p1 (f2 int);
CREATE TABLE p2 (f1 int);
CREATE TABLE c (f1 int) INHERITS (p1, p2);
CREATE TABLE c2 (f1 int) INHERITS (p3);

(Previous version will dump
CREATE TABLE c () INHERITS (p1, p2)
CREATE TABLE c2 () INHERITS (p3) )

Alvaro Herrera

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian - CVS 2002-10-09 16:21:54 pgsql-server/ oc/FAQ_AIX rc/Makefile.shlib rc/ ...
Previous Message Bruce Momjian - CVS 2002-10-09 04:59:39 pgsql-server/ oc/src/sgml/runtime.sgml oc/src/ ...