Nested Transactions

Started by Chris Broussardabout 24 years ago4 messagesgeneral
Jump to latest
#1Chris Broussard
cbroussard@liquiddatainc.com

i'm trying to accomplish the following task:

begin transaction;
begin work;
create table xyz(
id int
);
commit work;
select * from xyz;
rollback transaction;
select * from xyz; // should say database object doesn't exist

however i'm failing to be able to do this?? is there a specific reason?

I know in MSSQL you can say:

begin transaction
begin transaction test
create table xyz(
id [int]
);
select * from xyz
commit transaction test
rollback transaction
select * from xyz // database object doesn't exist

Is there an equivalent?

TIA

#2Noname
wsheldah@lexmark.com
In reply to: Chris Broussard (#1)
Re: Nested Transactions

I don't believe postgresql supports nested transactions yet.

Wes Sheldahl

cbroussard%liquiddatainc.com@interlock.lexmark.com (Chris) on 03/08/2002
02:12:33 AM

To: pgsql-general%postgresql.org@interlock.lexmark.com
cc: (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject: [GENERAL] Nested Transactions

i'm trying to accomplish the following task:

begin transaction;
begin work;
create table xyz(
id int
);
commit work;
select * from xyz;
rollback transaction;
select * from xyz; // should say database object doesn't exist

however i'm failing to be able to do this?? is there a specific reason?

I know in MSSQL you can say:

begin transaction
begin transaction test
create table xyz(
id [int]
);
select * from xyz
commit transaction test
rollback transaction
select * from xyz // database object doesn't exist

Is there an equivalent?

TIA

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

#3Doug McNaught
doug@wireboard.com
In reply to: Chris Broussard (#1)
Re: Nested Transactions

cbroussard@liquiddatainc.com (Chris) writes:

i'm trying to accomplish the following task:

begin transaction;
begin work;
create table xyz(
id int
);
commit work;
select * from xyz;
rollback transaction;
select * from xyz; // should say database object doesn't exist

PostgreSQL currently doesn't have nested transactions. They have been
discussed for a future version.

-Doug
--
Doug McNaught Wireboard Industries http://www.wireboard.com/

Custom software development, systems and network consulting.
Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...

#4Bruce Momjian
bruce@momjian.us
In reply to: Chris Broussard (#1)
Re: Nested Transactions

No, sorry, no nested transactions yet. It is on the TODO list.

---------------------------------------------------------------------------

Chris wrote:

i'm trying to accomplish the following task:

begin transaction;
begin work;
create table xyz(
id int
);
commit work;
select * from xyz;
rollback transaction;
select * from xyz; // should say database object doesn't exist

however i'm failing to be able to do this?? is there a specific reason?

I know in MSSQL you can say:

begin transaction
begin transaction test
create table xyz(
id [int]
);
select * from xyz
commit transaction test
rollback transaction
select * from xyz // database object doesn't exist

Is there an equivalent?

TIA

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026