X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 762C09FA5C3 for ; Fri, 16 Jun 2006 09:28:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 29460-02 for ; Fri, 16 Jun 2006 09:28:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from a2s5.a2hosting.com (host-209-124-50-10.a2webhosting.com [209.124.50.10]) by postgresql.org (Postfix) with ESMTP id 44C4E9FA42B for ; Fri, 16 Jun 2006 09:28:15 -0300 (ADT) Received: from adsl-153-118-13.tys.bellsouth.net ([70.153.118.13] helo=[192.168.1.10]) by a2s5.a2hosting.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.52) id 1FrDQo-0005P9-Qm; Fri, 16 Jun 2006 08:28:10 -0400 In-Reply-To: <20060615154930.44620.qmail@web54312.mail.yahoo.com> References: <20060615154930.44620.qmail@web54312.mail.yahoo.com> Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4B156402-1B7D-46E2-8A4F-9DBD3F119CB7@pgedit.com> Cc: pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: sessions and prepared statements Date: Fri, 16 Jun 2006 08:27:37 -0400 To: chester c young X-Mailer: Apple Mail (2.750) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - a2s5.a2hosting.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - pgedit.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/201 X-Sequence-Number: 25437 On Jun 15, 2006, at 11:49 AM, chester c young wrote: > in PHP for example, where there are multiple sessions and which you > get is random: > > how do you know if the session you're in has prepared a particular > statement? > > and/or how do you get a list of prepared statements? > > last, is there any after login trigger that one could use to > prepare statements the session would need? or is this a dumb idea? If you are using pooled connections, I don't think there is a reasonable way you could managed prepared statements across requests. You'll probably want to just prepare the ones you need for the current request and discard them when the request ends. I have a short article where you might find some useful information for managing prepared statements: http://pgedit.com/resource/php/pgfuncall You might also post your question to PostgreSQL PHP list -- probably more PHP expertise there. Best, John John DeSoi, Ph.D. http://pgedit.com/ Power Tools for PostgreSQL