Re: How to implement nested transactions - Mailing list pgsql-general

From Tom Lane
Subject Re: How to implement nested transactions
Date
Msg-id 23441.1138302879@sss.pgh.pa.us
Whole thread Raw
In response to How to implement nested transactions  ("Andrus" <eetasoft@online.ee>)
List pgsql-general
"Andrus" <eetasoft@online.ee> writes:
> I want to implement nest transactions like
> begin;
>   CREATE temp table t2 (foo char(20) primary key);
>   begin;
>     CREATE temp table t1 (bar char(20) primary key);
>     commit;
>   rollback;

That is not the correct syntax.  Use SAVEPOINT, then ROLLBACK TO SAVEPOINT
or RELEASE SAVEPOINT.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] [PATCH] Better way to check for getaddrinfo
Next
From: Tom Lane
Date:
Subject: Re: Arrays