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

From: David Wheeler <david(at)kineticode(dot)com>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Vlad <marchenko(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org, dbdpg-general(at)gborg(dot)postgresql(dot)org
Subject: Re: [Dbdpg-general] Re: 'prepare' is not quite schema-safe
Date: 2005-05-02 16:24:02
Message-ID: 15DFED4D-A169-440D-ABB0-1A1B3EEDEB82@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On May 2, 2005, at 06:14 , Neil Conway wrote:

> I'm not sure I quite follow you -- in some future version of the
> backend in which prepared queries are invalidated, this would be
> invisible to the client. The client wouldn't need to explicitly
> check for the "liveness" of the prepared query, they could just
> execute it -- if necessary, the backend will re-plan the query
> before executing it.

$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");

Regards,

David

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Wheeler 2005-05-02 16:24:48 Re: [Dbdpg-general] Re: 'prepare' is not quite schema-safe
Previous Message David Wheeler 2005-05-02 16:19:46 Re: [Dbdpg-general] Re: 'prepare' is not quite schema-safe