Re: Re: [COMMITTERS] pgsql: Coerce 'unknown' type parameters to the right type in the - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Coerce 'unknown' type parameters to the right type in the
Date
Msg-id 26494.1282225637@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Coerce 'unknown' type parameters to the right type in the  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: Re: [COMMITTERS] pgsql: Coerce 'unknown' type parameters to the right type in the  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> I'm starting to wonder if it's worth enforcing the rule that all unknown 
> Params must be coerced to the same target type. We could just document 
> the behavior. Or maybe we should revert the whole thing, and add a check 
> to PL/pgSQL EXECUTE USING code to just throw a nicer error message if 
> you pass an unknown parameter in the USING clause.

+1 for the latter.  There's no good reason to be passing unknowns to USING.
I'm also getting more and more uncomfortable with the amount of new
behavior that's being pushed into an existing SPI call.

Another possibility is for EXECUTE USING to coerce any unknowns to TEXT
before it calls the parser at all.  This would square with the typical
default assumption for unknown literals, and it would avoid having to
have any semantics changes below the SPI call.
        regards, tom lane


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: proposal: tuplestore, tuplesort aggregate functions
Next
From: Boxuan Zhai
Date:
Subject: gSoC add MERGE command new patch -- merge_v104