Re: [Fwd: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_pgsql package.xml pgsql_driver.c pgsql_statement.c php_pdo_pgsql_int.h] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [Fwd: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_pgsql package.xml pgsql_driver.c pgsql_statement.c php_pdo_pgsql_int.h]
Date
Msg-id 2171.1133110059@sss.pgh.pa.us
Whole thread Raw
In response to [Fwd: [PHP-CVS] cvs: php-src(PHP_5_1) /ext/pdo_pgsql package.xml pgsql_driver.c pgsql_statement.c php_pdo_pgsql_int.h]  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Is Wez of the PHP project correct here in that you can't find parameter 
> types of statements via libpq?

Per the description of PQprepare:

: At present, there is no way to determine the actual data type inferred
: for any parameters whose types are not specified in paramTypes[]. This
: is a libpq omission that will probably be rectified in a future release.

We need a function that exposes the protocol's Describe Statement
functionality ... or possibly better, extend PQprepare to include it.
(If PQprepare just does it automatically, then you don't need an extra
network round trip to get the info.)

I don't think this is as big a problem as he makes it out to be, though.
You should only be trying to use binary format for parameters that you
know darn well the type of, and for those you can make sure that you
specify the type to PQprepare instead of leaving it to be inferred.
Depending on the type-inference facility for arbitrary queries is
dangerous anyway.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PQfnumber() Fix Proposal
Next
From: Michael Fuhr
Date:
Subject: Re: Strange interval arithmetic