Re: fastgetattr & isNull
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2010-01-06T18:05:06Z
Lists: 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