Re: PL/pgSQL EXECUTE '..' USING with unknown - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PL/pgSQL EXECUTE '..' USING with unknown
Date
Msg-id 9204.1281918943@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/pgSQL EXECUTE '..' USING with unknown  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: PL/pgSQL EXECUTE '..' USING with unknown
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> One approach is to handle the conversion from unknown to the right data 
> type transparently in the backend. Attached patch adds a 
> coerce-param-hook for fixed params that returns a CoerceViaIO node to 
> convert the param to the right type at runtime. That's quite similar to 
> the way unknown constants are handled.

The idea of using a coerce_hook instead of inventing several new API
layers is attractive, but have you checked that there are no callers
for which this would be a bad idea?

Another issue is that this fails to mimic the usual varparams behavior
that a Param of unknown type should be resolved to only one type when it
is referenced in multiple places.  I'm not sure that that's a critical
behavior, but I'm definitely not sure that it's not.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: patch: utf8_to_unicode (trivial)
Next
From: Robert Haas
Date:
Subject: Re: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)