Re: Tuple data - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Tuple data
Date
Msg-id 19562.977019803@sss.pgh.pa.us
Whole thread Raw
In response to Re: Tuple data  ("Michael Richards" <miker@interchange.ca>)
List pgsql-hackers
"Michael Richards" <miker@interchange.ca> writes:
> Sometimes the t_hoff value in the tuple header is 32 which seems to indicate
> no NULL bitmap.

There's no null bitmap unless the HASNULLS infomask bit is set.

> This really makes me wonder what happens when you ALTER
> TABLE ADD COLUMN on a table since it doesn't seem to take more than O(1)
> time. Perhaps it is assumed if the attribute count is less than the actual
> number of attributes then the last ones are NULL and no NULL map is
> required.

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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: locking bug?
Next
From: Tom Lane
Date:
Subject: Re: 7.1 features list