Thread: What does this error mean?

What does this error mean?

From
Tom Allison
Date:
Cannot mix placeholder styles ":foo" and "$1" at /
sw/lib/perl5/5.8.6/darwin-thread-multi-2level//DBD/Pg.pm line 174.


I keep finding it from time to time on one script I have and I have
no clue what it's telling me.

Re: What does this error mean?

From
SCassidy@overlandstorage.com
Date:

Hi,

If you have a statement using placeholders like:

     select id from info where device_type = ? and drive_mfg = ?

and then prepare and execute it, something like:
       $sth=$dbh->prepare($stmt) ||  errexit("bad prepare for stmt $stmt, error: $DBI::errstr");
       $rc=$sth->execute('TYPE1','ACME') ||  errexit("can't execute statement:\n$stmt\nreturn code $rc: DB error: $DBI::errstr");

If the prepare thinks that the placeholders are of mixed types (as supported by the driver),  like:

select id from info where device_type = ? and drive_mfg = :2

Then, you will get the type of message you saw.

Probably your query is being built by the program where some odd character is occasionally creeping in where you don't expect it.  I assume that the html entity references ('"') are not actually in the error message.  


Susan Cassidy



Tom Allison <tom@tacocat.net>
Sent by: pgsql-general-owner@postgresql.org

05/23/2007 03:59 PM

To
General PostgreSQL List <pgsql-general@postgresql.org>
cc
Subject
[GENERAL] What does this error mean?





Cannot mix placeholder styles &quot;:foo&quot; and &quot;$1&quot; at /
sw/lib/perl5/5.8.6/darwin-thread-multi-2level//DBD/Pg.pm line 174.


I keep finding it from time to time on one script I have and I have  
no clue what it's telling me.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------

Re: What does this error mean?

From
Tom Allison
Date:
The &quot; is definitely not the error -- it's a CGI thing.

I think this might  tie back to another email I posted where I'm trying to escape all these characters programmatically instead of passing them in as '?' and letting perl to the parsing for me.

On May 23, 2007, at 8:00 PM, SCassidy@overlandstorage.com wrote:


Hi,

If you have a statement using placeholders like:

     select id from info where device_type = ? and drive_mfg = ?

and then prepare and execute it, something like:
       $sth=$dbh->prepare($stmt) ||  errexit("bad prepare for stmt $stmt, error: $DBI::errstr");
       $rc=$sth->execute('TYPE1','ACME') ||  errexit("can't execute statement:\n$stmt\nreturn code $rc: DB error: $DBI::errstr");

If the prepare thinks that the placeholders are of mixed types (as supported by the driver),  like:

select id from info where device_type = ? and drive_mfg = :2

Then, you will get the type of message you saw.

Probably your query is being built by the program where some odd character is occasionally creeping in where you don't expect it.  I assume that the html entity references ('&quot;') are not actually in the error message.  


Susan Cassidy



Tom Allison <tom@tacocat.net>
Sent by: pgsql-general-owner@postgresql.org

05/23/2007 03:59 PM

To
General PostgreSQL List <pgsql-general@postgresql.org>
cc
Subject
[GENERAL] What does this error mean?





Cannot mix placeholder styles &quot;:foo&quot; and &quot;$1&quot; at /
sw/lib/perl5/5.8.6/darwin-thread-multi-2level//DBD/Pg.pm line 174.


I keep finding it from time to time on one script I have and I have  
no clue what it's telling me.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------

Re: What does this error mean?

From
Tom Allison
Date:
I noticed that the option for 'E' is not enabled in 8.2 by default (  standard_conforming_strings (boolean)  ).
I turned this on and the SQL statements went from 0.5 sec to 3.8 sec each.
Is this expected?

On May 23, 2007, at 8:00 PM, SCassidy@overlandstorage.com wrote:


Hi,

If you have a statement using placeholders like:

     select id from info where device_type = ? and drive_mfg = ?

and then prepare and execute it, something like:
       $sth=$dbh->prepare($stmt) ||  errexit("bad prepare for stmt $stmt, error: $DBI::errstr");
       $rc=$sth->execute('TYPE1','ACME') ||  errexit("can't execute statement:\n$stmt\nreturn code $rc: DB error: $DBI::errstr");

If the prepare thinks that the placeholders are of mixed types (as supported by the driver),  like:

select id from info where device_type = ? and drive_mfg = :2

Then, you will get the type of message you saw.

Probably your query is being built by the program where some odd character is occasionally creeping in where you don't expect it.  I assume that the html entity references ('&quot;') are not actually in the error message.  


Susan Cassidy



Tom Allison <tom@tacocat.net>
Sent by: pgsql-general-owner@postgresql.org

05/23/2007 03:59 PM

To
General PostgreSQL List <pgsql-general@postgresql.org>
cc
Subject
[GENERAL] What does this error mean?





Cannot mix placeholder styles &quot;:foo&quot; and &quot;$1&quot; at /
sw/lib/perl5/5.8.6/darwin-thread-multi-2level//DBD/Pg.pm line 174.


I keep finding it from time to time on one script I have and I have  
no clue what it's telling me.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------

Re: What does this error mean?

From
Tom Allison
Date:
never mind.  first query after a restart is slow...

On May 23, 2007, at 10:14 PM, Tom Allison wrote:

I noticed that the option for 'E' is not enabled in 8.2 by default (  standard_conforming_strings (boolean)  ).
I turned this on and the SQL statements went from 0.5 sec to 3.8 sec each.
Is this expected?

On May 23, 2007, at 8:00 PM, SCassidy@overlandstorage.com wrote:


Hi,

If you have a statement using placeholders like:

     select id from info where device_type = ? and drive_mfg = ?

and then prepare and execute it, something like:
       $sth=$dbh->prepare($stmt) ||  errexit("bad prepare for stmt $stmt, error: $DBI::errstr");
       $rc=$sth->execute('TYPE1','ACME') ||  errexit("can't execute statement:\n$stmt\nreturn code $rc: DB error: $DBI::errstr");

If the prepare thinks that the placeholders are of mixed types (as supported by the driver),  like:

select id from info where device_type = ? and drive_mfg = :2

Then, you will get the type of message you saw.

Probably your query is being built by the program where some odd character is occasionally creeping in where you don't expect it.  I assume that the html entity references ('&quot;') are not actually in the error message.  


Susan Cassidy



Tom Allison <tom@tacocat.net>
Sent by: pgsql-general-owner@postgresql.org

05/23/2007 03:59 PM

To
General PostgreSQL List <pgsql-general@postgresql.org>
cc
Subject
[GENERAL] What does this error mean?





Cannot mix placeholder styles &quot;:foo&quot; and &quot;$1&quot; at /
sw/lib/perl5/5.8.6/darwin-thread-multi-2level//DBD/Pg.pm line 174.


I keep finding it from time to time on one script I have and I have  
no clue what it's telling me.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------