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 375.986152556@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: Changing the default value of an inherited column  (Christopher Masto <chris@netmonger.net>)
Responses Re: Re: Changing the default value of an inherited column  (ncm@zembu.com (Nathan Myers))
List pgsql-hackers
Christopher Masto <chris@netmonger.net> writes:
> Another thing that seems kind of interesting would be to have:
> CREATE TABLE base (table_id CHAR(8) NOT NULL [, etc.]);
> CREATE TABLE foo  (table_id CHAR(8) NOT NULL DEFAULT 'foo');
> CREATE TABLE bar  (table_id CHAR(8) NOT NULL DEFAULT 'bar');
> Then a function on "base" could look at table_id and know which
> table it's working on.  A waste of space, but I can think of
> uses for it.

This particular need is superseded in 7.1 by the 'tableoid'
pseudo-column.  However you can certainly imagine variants of this
that tableoid doesn't handle, for example columns where the subtable
creator can provide a useful-but-not-always-correct default value.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-hackers-owner+M6959@postgresql.org: Majordomo Delivery Error]
Next
From: Roberto Mello
Date:
Subject: Re: PL/SQL and null