Subject: | Executing Prepared Statement Fails with Syntax Error |
DBI Version: 1.48
DBD::Pg Version: 1.43
Using perl from Fedora Core 4:
perl -v: This is perl, v5.8.6 built for i386-linux-thread-multi
uname -a: Linux 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 i686 i686 i386 GNU/Linux
The following succeeds:
$sth = $dbh->prepare(q[select timezone('zulu',?)]);
$sth->execute('2005-10-26 12:00:00 CST');
print "Got " . $sth->fetchrow_arrayref->[0] . "\n"; # Prints "2005-10-26 18:00:00"
The following fails:
$sth = $dbh->prepare(q[select extract(epoch from timestamp with time zone ?)]);
$sth->execute('2005-10-26 12:00:00 CST');
with error
DBD::Pg::st execute failed: ERROR: syntax error at or near "$1" at character 52