Hi,
Based on the discussion in the bug report, I have recoded my
application to change the placeholder strings from something like
'timestamp ?,' to '?::timestamp'. The reason for this change is that
DBD::Pg went from fake local placeholders to server side
placeholders, and this entails much stricter checking of the
placeholder syntax.
It would be nice if there was some more initmation of this
change -- I think it at least merits a NEWS entry, since the change
breaks any script that uses non-trivial placeholders.
Actually, it does not even need to be that non-trivial:
,----
| __> perl -MDBI -e 'my $dbh = DBI->connect("DBI:Pg:dbname=tes", \
| "srivasta", "", { RaiseError => 1}); \
| my $sth = $dbh->prepare("SELECT inet ?"); \
| $sth->execute("127.0.0.1")'
| DBD::Pg::st execute failed: ERROR: syntax error at or near "$1" at
| character 13
| __>
`----
On IRC, Jason Rhinelander discovered that after reading
through this bug report and the linked articles, it appears to come
down to a very simple case: "SELECT interval ?" doesn't work with
server-side placeholders, which DBD::Pg started using between 1.3x
and the current version. Prior to switching to server-side
placeholders, that worked because DBD::Pg faked placeholders by
creating a whole string, then sending it to the backend (which is
exactly what placeholderless ->do code does).
This information is also in the message from Ivan Kohler, seen at:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315708;msg=62
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315708;msg=67)
The two mailing lists posts pointed to by Niko Tyni in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315708;msg=81
are very interesting.
Jason Rhinelander also suggested that something like:
$sth->bind_param(1, $timestamp, DBD::Pg::PG_TIMESTAMP);
$sth->bind_param(2, $interval, DBD::Pg::PG_TINTERVAL);
etc. would also work, but I have not tested that.
manoj
--
Are you having fun yet?
Manoj Srivastava <[EMAIL PROTECTED]> <http://www.debian.org/~srivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B 924B 21BA DABB BF24 424C
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]