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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Christopher Masto <chris(at)netmonger(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Changing the default value of an inherited column
Date: 2001-04-01 19:15:56
Message-ID: 375.986152556@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Masto <chris(at)netmonger(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberto Mello 2001-04-01 22:13:18 Re: PL/SQL and null
Previous Message Tom Lane 2001-04-01 19:10:52 Re: [pgsql-hackers-owner+M6959@postgresql.org: Majordomo Delivery Error]