Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 83830
Status: rejected
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: barwick [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: FYI: error with placeholders in CONCAT() function
Date: Fri, 8 Mar 2013 23:22:42 +0900
To: bug-DBD-Pg [...] rt.cpan.org
From: Ian Lawrence Barwick <barwick [...] gmail.com>
DBD::Pg version: 2.19.3 PostgreSQL version: 9.2.3 ----------------------------------------------------- use strict; use DBI; my $dbh = DBI->connect( 'dbi:Pg:dbname=testdb', 'barwick', '', { PrintError => 1, RaiseError => 0 } ); my $sth = $dbh->prepare(q|SELECT CONCAT('foo', ?)|); $sth->execute('bar'); ----------------------------------------------------- Executing the above produces the following error DBD::Pg::st execute failed: ERROR: could not determine data type of parameter $1 at concat.pl line 17.
Show quoted text
> my $sth = $dbh->prepare(q|SELECT CONCAT('foo', ?)|); > DBD::Pg::st execute failed: ERROR: could not determine data type of > parameter $1 at concat.pl line 17.
That's a Postgres error, not a DBD::Pg one. You need to supply Postres with a little more information about what type you are trying to join together. For example, you could use: SELECT CONCAT('foo', ?::text) Alternatively, you can turn offperpared statements at the server side entirely: my $sth = $dbh->prepare($SQL, { pg_server_prepare => 0});