Re: hiding variable-length fields from Form_pg_* structs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: hiding variable-length fields from Form_pg_* structs
Date: 2011-12-05 20:12:24
Message-ID: 3157.1323115944@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, Dec 5, 2011 at 2:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>>> To clarify, I believe the rule is that the first variable-length field
>>> can be accessed as a struct field. Are there any exceptions to this?

>> If it is known not null, yes, but I wonder just how many places actually
>> depend on that.

> My impression is that all the varlena fields also allow nulls.

See MARKNOTNULL in bootstrap.c. I think the exceptions were designed to
protect direct accesses to pg_index.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-12-05 20:12:35 JSON for PG 9.2
Previous Message Peter Eisentraut 2011-12-05 20:11:05 Re: pg_upgrade automatic testing