Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F0B35475925 for ; Thu, 21 Nov 2002 04:44:50 -0500 (EST) Received: from mail04.svc.cra.dublin.eircom.net (mail04.svc.cra.dublin.eircom.net [159.134.118.20]) by postgresql.org (Postfix) with SMTP id F086C4758DC for ; Thu, 21 Nov 2002 04:44:49 -0500 (EST) Received: (qmail 85001 messnum 1110999 invoked from network[159.134.167.242/p1010.as1.limerick1.eircom.net]); 21 Nov 2002 09:44:50 -0000 Received: from p1010.as1.limerick1.eircom.net (HELO dansat.data-plan.com) (159.134.167.242) by mail04.svc.cra.dublin.eircom.net (qp 85001) with SMTP; 21 Nov 2002 09:44:50 -0000 Received: from dansat.data-plan.com (localhost [127.0.0.1]) by dansat.data-plan.com (8.12.6/8.12.6) with ESMTP id gAL9imao017027; Thu, 21 Nov 2002 09:44:48 GMT (envelope-from timbo@dansat.data-plan.com) Received: (from timbo@localhost) by dansat.data-plan.com (8.12.6/8.12.6/Submit) id gAL9idnY017026; Thu, 21 Nov 2002 09:44:39 GMT Date: Thu, 21 Nov 2002 09:44:39 +0000 From: Tim Bunce To: David Wheeler Cc: Tim Bunce , Rudy Lippan , dbi-dev@perl.org, pgsql-interfaces@postgresql.org Subject: Re: DBD::PgSQL: More Queestions Message-ID: <20021121094439.GH381@dansat.data-plan.com> References: <20021120150213.GZ381@dansat.data-plan.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/134 X-Sequence-Number: 3382 On Wed, Nov 20, 2002 at 07:02:12PM -0800, David Wheeler wrote: > On Wednesday, November 20, 2002, at 07:02 AM, Tim Bunce wrote: > > Hrm, yes, good point. If I end up using PostgtreSQL 7.3's server-side > prepare, though, I'll likely to something similar to this, though, as > the execute syntax is (roughly): > > EXECUTE prepared_statement_name('param1', 'param2', 'paramn') > > So I would just have to append the escaped parameters in turn to > "EXECUTE prepared_statement_name(" plus a closing ")". > > I need to think about how to create a prepared statement name, though. > Some sort of hash (like MD5) would be good, but that might incur too > much overhead. Ideas? MD5 is pretty quick and the base64 result string is short. But if prepared_statement_name's are local to the session then you could just use a sequential integer. When a statement handle is destroyed then you can tell the server to discard the statement. You could also let the application specify a name: $dbh->prepare("...", { pg_sth_name => "..." }); Tim.