debugging: prepared statement "dbdpg_7" already exists

Mark Stosberg <mark-WmyhgDpj2fCHT8/[email protected]>
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
Hello,

After deploying DBD::Pg 1.48 on a load-balanced web server talking to
PostgreSQL 8.1, I'm seeing a /lot/ of these kind of errors:

 prepared statement "dbdpg_7" already exists

Could this be because there DBD::Pg is on two different machines,
talking to the same database, and each has different concept of
what should be stored in 'dbdpg_7' ?

If so, it would be nice if this could be avoided.

Using a hash of the query itself would be a useful key, because that
means it could originate on one of the front end web servers,
and then be re-used by one of the other ones.

In the meantime, I suppose we could use the documented syntax for 
"pg_prepare_name" to workaround the issue.

If also curious-- are there other syntaxes that work for setting
pg_prepare_name, such as this: (?)

$sth->prepare("SELECT 123", {pg_prepare_name => 'foo' });

( Unrelated, there a couple of typos in the docs where

 "pg_prepare_now = "  ... should really have the fat arrow ( "=>" ).

    Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.