"PFC" <[EMAIL PROTECTED]> writes:

>       But, using prepared statements with persistent connections is messy,
> because you never know if the connection is new or not, if it contains  
> already
> prepared statements or not, you'd have to maintain a list of those  statements
> (named) for every query in your application, and when someone  changes a 
> query,
> it's a mess, not to mention queries generated by the ORM  like Rails etc.

Well if you're caching per-connection then it doesn't really matter whether
you do it on the client side or the server side, it's pretty much exactly the
same problem.

Unsurprisingly most drivers do precisely what you're describing. In Perl DBI
for example you just change $dbh->prepare("") into $dbh->prepare_cached("")
and it does exactly what you want. I would expect the PHP drivers to have
something equivalent.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's Slony Replication support!

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to