postgresql/src
Bruce Momjian ba8e20a6dd > Alvaro Herrera <alvherre@atentus.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
2002-10-09 16:20:25 +00:00
..
backend Have SET not start transaction when autocommit off, with doc updates. 2002-10-09 04:59:38 +00:00
bin > Alvaro Herrera <alvherre@atentus.com> writes: 2002-10-09 16:20:25 +00:00
corba
data
include Again improve MemSet comments. 2002-10-08 23:12:22 +00:00
interfaces fixed missing apostrophe 2002-10-08 01:47:55 +00:00
makefiles Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
pl Back out /pl memory leak patch. Wait for new version. 2002-09-26 05:39:03 +00:00
port pgindent run. 2002-09-04 20:31:48 +00:00
template Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
test Restore NOTICEs that were mistakenly removed from triggers regression 2002-10-03 18:40:02 +00:00
tools Update symbols for 7.3. 2002-09-04 19:11:06 +00:00
tutorial Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
utils The attached patch fixes a number of issues related to compiling the 2002-10-03 17:09:42 +00:00
DEVELOPERS
Makefile Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
Makefile.global.in Remove leftovers from subproject removals. Fixes for Python and Kerberos 2002-09-04 22:54:18 +00:00
Makefile.shlib Assorted fixes for Cygwin: 2002-09-05 18:28:46 +00:00
nls-global.mk Avoid shell syntax error if list of languages is empty. 2002-09-02 22:19:42 +00:00
win32.mak Remove all traces of multibyte and locale options. Clean up comments 2002-09-03 21:45:44 +00:00