Re: DBD::Pg: Placeholders not working - Mailing list pgsql-general

From postgres@vrane.com
Subject Re: DBD::Pg: Placeholders not working
Date
Msg-id 20020519230909.B1777@amd.universe
Whole thread Raw
In response to DBD::Pg: Placeholders not working  (Andrew Perrin <clists@perrin.socsci.unc.edu>)
List pgsql-general
On Sun, May 19, 2002 at 10:48:42PM -0400, Andrew Perrin wrote:
> Greetings-
>
> Recently I upgraded to PostgreSQL 7.2.1, running under debian's
> "woody" release. Since then, perl scripts using DBD::Pg and placeholders
> aren't working. The equivalent SQL statements, sent through DBD::Pg, work
> fine, so I know it's a problem with the placeholders.  I've upgraded to
> the most recent DBD::Pg (1.13).
>
> Here's the symptom:
>
> my $put = $dbh->prepare('UPDATE letters SET sc_auth_sum = ?, ' .
>     'sc_anti_auth_sum = ?, ' .
>     'sc_pro_auth_sum = ?, sc_auth_valence = ? WHERE letterid = ' .
>     '?');
>


I have been using 7.2.1 almost as soon as it came out
and don't experience your problem.  My DBD::Pg is 1.12 however.

I really wonder why you don't have a much more readable statement like

----------------------------
 my $put = $dbh->prepare('UPDATE letters SET sc_auth_sum = ?,
       sc_anti_auth_sum = ?,
       sc_pro_auth_sum = ?, sc_auth_valence = ? WHERE letterid =
       ?');
---------------------------

Postgres does not care much if you put in line breaks.

pgsql-general by date:

Previous
From: Andrew Perrin
Date:
Subject: DBD::Pg: Placeholders not working
Next
From: Tom Lane
Date:
Subject: Re: DBD::Pg: Placeholders not working