Re: Re: Changing the default value of an inherited column

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Changing the default value of an inherited column
Date: 2001-04-03 06:01:31
Message-ID: 3.0.5.32.20010403160131.02916100@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 23:57 2/04/01 -0400, Tom Lane wrote:
>
>NOT NULL on a child field would only force it to be dumped if none
>of the parents say NOT NULL. Type name really is not an issue since
>it will have to be the same in all the tables anyway; I wouldn't bother
>expending any code there.
>

I've made tha changes and it all seems to work, bu there is a minor
inconsistency:

create table p3_def1(f1 int default 1, f2 int);
create table c5(f1 int not null, f3 int) inherits(p3_def1);

c5 gets dumped as:

CREATE TABLE "c5" (
"f1" integer DEFAULT 1 NOT NULL,
"f3" integer
)
inherits ("p3_def1");

since the NOT NULL forces the field to dump, and it is dumps as though it
were a real field.

Similarly,

create table p2_nn(f1 int not null, f2 int not null);
create table c6(f1 int default 2, ,f3 int) inherits(p2_nn);

results in C6 being dumped as:

CREATE TABLE "c6" (
"f1" integer DEFAULT 2 NOT NULL,
"f3" integer
)
inherits ("p2_nn");

I think it needs to dump ONLY the overridden settigns, since a change to
the overriding behaviour of a child seems like a bad thing.

What do you think?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2001-04-03 08:55:36 Re: Re: Changing the default value of an inherited column
Previous Message Adriaan Joubert 2001-04-03 05:29:25 Re: Bug in user-defined types?