pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Bunce <Tim.Bunce@pobox.com>
To: David Wheeler <david@wheeler.net>
Cc: Tim Bunce <Tim.Bunce@pobox.com>
Cc: Rudy Lippan <rlippan@remotelinux.com>
Cc: dbi-dev@perl.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: DBD::PgSQL: More Queestions
Date: Thu, 21 Nov 2002 09:44:39 +0000
Message-ID: <20021121094439.GH381@dansat.data-plan.com> (raw)
In-Reply-To: <A1BF32B2-FCFD-11D6-8943-0003931A964A@wheeler.net>
References: <20021120150213.GZ381@dansat.data-plan.com>
	<A1BF32B2-FCFD-11D6-8943-0003931A964A@wheeler.net>

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.



view thread (11+ messages)  latest in thread

Message-ID: <20021121094439.GH381@dansat.data-plan.com>
Permalink:  ../20021121094439.GH381@dansat.data-plan.com/
Also on:    postgresql.org/message-id/20021121094439.GH381@dansat.data-plan.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: Tim.Bunce@pobox.com, david@wheeler.net, rlippan@remotelinux.com, dbi-dev@perl.org
  Subject: Re: DBD::PgSQL: More Queestions
  In-Reply-To: <20021121094439.GH381@dansat.data-plan.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox