Begin block

Hello,

I'm very much a Postgres PHP novice. I have a number of queries that
need to be run as a single transaction. One set of those will only be
run some of the time, but other times will need to be imbedded in
another block. Can I imbed a begin/commit inside another begin/commit?

Thanks,
Carol

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
Carol Walter [ Mi, 01 Juli 2009 19:52 ] [ ID #2007035 ]

Re: Begin block

On 01/07/2009 18:52, Carol Walter wrote:
> Hello,
>
> I'm very much a Postgres PHP novice. I have a number of queries that
> need to be run as a single transaction. One set of those will only be
> run some of the time, but other times will need to be imbedded in
> another block. Can I imbed a begin/commit inside another begin/commit?

Hi there,

I'm not sure about nested transactions, but you can achieve the same
effect with savepoints:

http://www.postgresql.org/docs/8.4/static/sql-savepoint.html

HTH,

Ray.

------------------------------------------------------------ ------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod [at] iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------ ------

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
Rod [ Mi, 01 Juli 2009 19:57 ] [ ID #2007036 ]

Re: Begin block

On 2009-07-01, Carol Walter <walterc [at] indiana.edu> wrote:
> Hello,
>
> I'm very much a Postgres PHP novice. I have a number of queries that
> need to be run as a single transaction. One set of those will only be
> run some of the time, but other times will need to be imbedded in
> another block. Can I imbed a begin/commit inside another begin/commit?

No, but perhaps you can fake it using savepoints.

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
Jasen Betts [ Do, 02 Juli 2009 11:13 ] [ ID #2007148 ]

Re: Begin block

> I'm very much a Postgres PHP novice. I have a number of
> queries that need to be run as a single transaction. One set
> of those will only be run some of the time, but other times
> will need to be imbedded in another block. Can I imbed a
> begin/commit inside another begin/commit?
>


Nested transactions are not allowed in Postgresql you must use
savepoints.

Nick

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
Nick Hajek [ Mi, 01 Juli 2009 20:02 ] [ ID #2007384 ]
Datenbanken » gmane.comp.db.postgresql.php » Begin block

Vorheriges Thema: pg_query_params
Nächstes Thema: PDO, postgre and PHP data types