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 920DD9FA5C3 for ; Fri, 16 Jun 2006 10:09:39 -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 33045-03 for ; Fri, 16 Jun 2006 10:09:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id B591C9FA42B for ; Fri, 16 Jun 2006 10:09:29 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k5GD9MIF046941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Jun 2006 07:09:25 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k5GD9Le2031636; Fri, 16 Jun 2006 07:09:21 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k5GD9LCG031635; Fri, 16 Jun 2006 07:09:21 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 16 Jun 2006 07:09:21 -0600 From: Michael Fuhr To: Rod Taylor Cc: John DeSoi , chester c young , pgsql-sql@postgresql.org Subject: Re: sessions and prepared statements Message-ID: <20060616130921.GA31604@winnie.fuhr.org> References: <20060615154930.44620.qmail@web54312.mail.yahoo.com> <4B156402-1B7D-46E2-8A4F-9DBD3F119CB7@pgedit.com> <1150462516.777.550.camel@home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1150462516.777.550.camel@home> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/203 X-Sequence-Number: 25439 On Fri, Jun 16, 2006 at 08:55:16AM -0400, Rod Taylor wrote: > BEGIN; > SAVEPOINT; > SELECT * FROM temporary_prepared_statement; > ROLLBACK TO SAVEPOINT < on failure>; > CREATE TEMPORARY TABLE temporary_prepared_statement ...; > COMMIT; > > Now you have a place to store and retrieve prepared connection state for > the lifetime of the database backend provided PHP doesn't remove > temporary tables on the connection. This doesn't help today, but 8.2 will have a pg_prepared_statements view. http://archives.postgresql.org/pgsql-committers/2006-01/msg00143.php http://developer.postgresql.org/docs/postgres/view-pg-prepared-statements.html test=> PREPARE stmt (integer) AS SELECT * FROM foo WHERE x = $1; test=> \x Expanded display is on. test=> SELECT * FROM pg_prepared_statements; -[ RECORD 1 ]---+---------------------------------------------------------- name | stmt statement | PREPARE stmt (integer) AS SELECT * FROM foo WHERE x = $1; prepare_time | 2006-06-16 07:07:41.682999-06 parameter_types | {integer} from_sql | t -- Michael Fuhr