Re: Number of attributes in HeapTupleHeader

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>, mkoi-pg(at)aon(dot)at, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Number of attributes in HeapTupleHeader
Date: 2002-05-06 01:48:24
Message-ID: 24616.1020649704@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
> IMHO, the current ADD COLUMN mechanism is a hack. Besides requiring
> redundant on-disk data (t_natts), it isn't SQL compliant (because
> default values or NOT NULL can't be specified), and depends on
> a low-level kludge (that the storage system will return NULL for
> any attnums > the # of the attributes stored in the tuple).

It could be improved if anyone felt like working on it.

Hint: instead of returning NULL for col > t_natts, you could instead
return whatever default value is specified for the column... at least
for the case of a constant default, which is the main thing people
are interested in IMHO.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-05-06 01:49:51 Re: HEADS UP: Win32/OS2/BeOS native ports
Previous Message Christopher Kings-Lynne 2002-05-06 01:43:37 Re: HEADS UP: Win32/OS2/BeOS native ports