David Wheeler wrote:
> On Sep 17, 2004, at 6:23 PM, Oliver Jowett wrote:
>
>>> template1=> prepare s1(int) as select typname from pg_type where oid
>>> = $1;
>>> PREPARE
>>> template1=> execute s1('16');
>>> typname ---------
>>> bool
>>> (1 row)
>
>
> You're still telling it the type via that int.
Well, obviously. I haven't modified the backend code to accept 'unknown'
in PREPARE..
My point was the client does *not* need to know the type inferred by the
PREPARE in the 'unknown' case to make use of the resulting statement. It
can pass all parameters as text and use the type inference that happens
on EXECUTE -- as is happening in the EXECUTE quoted above.
-O