Re: fastgetattr & isNull - Mailing list pgsql-hackers

From Tom Lane
Subject Re: fastgetattr & isNull
Date
Msg-id 19485.1262801106@sss.pgh.pa.us
Whole thread Raw
In response to fastgetattr & isNull  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: fastgetattr & isNull  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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.

Still, it's not entirely clear to me why ignoring the possibility of
a null value would be a good idea.  So far as I can see, we have at
least the following coding pattern everywhere this is used:
    fastgetattr(..., &isnull);    Assert(!isnull);

and I don't think it's good coding style to go without even an Assert.
So +1 for removing the support for a null pointer ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: [pgsql-www] tribble.postgresql.org - planned maintenance downtime
Next
From: Alvaro Herrera
Date:
Subject: Re: [pgsql-www] tribble.postgresql.org - planned maintenance downtime