Re: sessions and prepared statements

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: John DeSoi <desoi(at)pgedit(dot)com>, chester c young <chestercyoung(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: sessions and prepared statements
Date: 2006-06-16 13:09:21
Message-ID: 20060616130921.GA31604@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Joe 2006-06-16 13:29:44 Re: Repetitive code
Previous Message Rod Taylor 2006-06-16 12:55:16 Re: sessions and prepared statements