Re: Bug in SQL/MED? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in SQL/MED?
Date
Msg-id 22695.1309892496@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in SQL/MED?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bug in SQL/MED?
List pgsql-hackers
I wrote:
> I think it might be better to keep the convention that an empty options
> list is represented by null, and to say that if a validator wants to be
> called on such a list, it had better declare itself non-strict.  At
> least we ought to think about that before redefining the catalog
> semantics at this late hour.

Another possibility that just occurred to me is to call the validator
like this:
   if (OidIsValid(fdwvalidator))   {       Datum    valarg = result;
       /* pass a null options list as an empty array */       if (DatumGetPointer(valarg) == NULL)           valarg =
construct_empty_array(TEXTOID);      OidFunctionCall2(fdwvalidator, valarg, ObjectIdGetDatum(catalogId));   }
 

This would avoid messing with the semantics of empty options lists
throughout foreigncmds.c, and also avoid requiring validators to deal
with null arguments.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: SSI atomic commit
Next
From: Robert Haas
Date:
Subject: Re: SSI atomic commit