#33736 [Fbk]: PDO confuses pgsql cast operator with named parameter
| From: | wez@php.net | Date: | Mon, 18 Jul 2005 14:47:59 +0000 |
| Subject: | #33736 [Fbk]: PDO confuses pgsql cast operator with named parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-82039@lists.php.net to get a copy of this message | ||
ID: 33736
Updated by: wez@php.net
Reported By: php at sagi dot org
Status: Feedback
Bug Type: PDO related
Operating System: Linux
PHP Version: 5.1.0b2
New Comment:
Please try the snap dated *after* this message.
Previous Comments:
------------------------------------------------------------------------
[2005-07-18 16:47:20] wez@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2005-07-17 20:04:17] php at sagi dot org
Description:
------------
I'm trying to execute a query similar to this:
INSERT INTO table (name, created_at) VALUES (:name,
FROM_UNIXTIME(:created_at)::TIMESTAMP);
On postgres7.4. FROM_UNIXTIME is a custom function, I try to cast its
value to TIMESTAMP using the '::' operator.
However, PDO thinks ':TIMESTAMP' is a name of another parameter, so it
throws this exception: 'SQLSTATE[HY093]: Invalid parameter number:
parameter was not defined'
Perhaps PDO should not treat '::' as a parameter or at least provide a
way to escape ':'.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33736&edit=1