Re: Tuple data - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Tuple data
Date
Msg-id 8405.977101540@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tuple data  (Hiroshi Inoue <Inoue@tpf.co.jp>)
List pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
>> Tom Lane wrote:
>>>>> ALTER ADD COLUMN doesn't touch any tuples, and you're right that it's
>>>> critically dependent on heap_getattr returning NULL when an attribute
>>>> beyond the number of attributes actually present in a tuple is accessed.
>>>> That's a fragile and unclean implementation IMHO --- see past traffic
>>>> on this list.

> I don't remember the traffic either.
> IIRC,I objected to Tom at this point in pgsql-bugs recently.

That was the traffic I was recalling ;-)

> I think it's very important for dbms that ALTER ADD COLUMN
> touches tuples as less as possible.

I disagree.  The existing ADD COLUMN implementation only works for
appending columns at the end of tuples; it can't handle inserting
a column.  To make it usable for inherited tables requires truly
horrendous kluges (as you well know).  IMHO we'd be far better off
to rewrite ADD COLUMN so that it does go through and change all the
tuples, and then we could get rid of the hackery that tries --- not
very successfully --- to deal with inconsistent column orders between
parent and child tables.

I have a similar opinion about DROP COLUMN ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: TOAST-table vacuuming (was Re: Idea for reducing planning time)
Next
From: "Michael Richards"
Date:
Subject: Re: Tuple data