Re: Re: Changing the default value of an inherited column - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: Changing the default value of an inherited column
Date
Msg-id 22530.986020582@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Changing the default value of an inherited column  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: Re: Changing the default value of an inherited column  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> Not a squawk as such, but does this have implications for pg_dump?

Good point.  With recently-committed changes, try:

regression=# create table p1 (f1 int default 42 not null, f2 int);
CREATE
regression=# create table c1 (f1 int, f2 int default 7) inherits (p1);
NOTICE:  CREATE TABLE: merging attribute "f1" with inherited definition
NOTICE:  CREATE TABLE: merging attribute "f2" with inherited definition
CREATE
regression=# create table c2 (f1 int default 43, f2 int not null) inherits (p1);
NOTICE:  CREATE TABLE: merging attribute "f1" with inherited definition
NOTICE:  CREATE TABLE: merging attribute "f2" with inherited definition
CREATE

pg_dump dumps both c1 and c2 like this:

CREATE TABLE "c2" (

)
inherits ("p1");

which is OK as far as the field set goes, but it loses the additional
DEFAULT and NOT NULL information for the child table.  Any thoughts on
the best way to fix this?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Re: 7.1 pg_dump fails for user-defined types (release stopper?)
Next
From: Philip Warner
Date:
Subject: Re: Re: Changing the default value of an inherited column