Re: fastgetattr & isNull

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: fastgetattr & isNull
Date: 2010-01-06 18:17:22
Message-ID: 603c8f071001061017y334047den1e993257a9b1e04@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 6, 2010 at 1:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> The fastgetattr() attempts to make provision for the case where isnull
>> is a NULL pointer, but it doesn't seem to work.  I tried it and got:
>
>> relcache.c:494: error: invalid use of void expression
>> relcache.c:494: error: invalid use of void expression
>> relcache.c:494: warning: left-hand operand of comma expression has no effect
>> relcache.c:494: warning: left-hand operand of comma expression has no effect
>
> Hmm.  I think the macro means to handle the case where the argument is a
> pointer variable whose value is null, not the case of writing "NULL" as
> a literal argument.

Hmm, I didn't think of that. I don't see any attempt at doing that in
the source code anywhere, though.

> Still, it's not entirely clear to me why ignoring the possibility of
> a null value would be a good idea.

It's harmless if (Datum) 0 can't be a datum of the relevant type,
because you can still distinguish whether you got a result back. But
you can always pass a dummy boolean point if you really want to do
that.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Leonardo F 2010-01-06 18:21:03 Re: I: TODO: Allow substring/replace() to get/set bit values
Previous Message Tom Lane 2010-01-06 18:16:53 Re: fastgetattr & isNull