Search Postgresql Archives

Re: [Dbdpg-general] Re: 'prepare' is not quite schema-safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On May 2, 2005, at 06:36 , Vlad wrote:

as I understood Tom's message, he's not advising dbd::pg driver to
rely on the fact that earlier prepared query is still valid.

That's not going to change. It's your responsibility, as the programmer, to know when you need to expire the cache:



$dbh->do("SET search_path TO one"); my $sth1 = $dbh->prepare_cached("SELECT * FROM test WHERE item = ?"); $sth1->execute("one");


$dbh->do("set search_path to two"); @{$dbh->{CachedKids}} = (); # Expire the cache! my $sth2 = $dbh->prepare_cached("SELECT * FROM test WHERE item = ?"); $sth2->execute("two");

(Sorry that was stuck in another reply to Neil. Trying to do too many things at once!)

Best,

David

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux