Re: [HACKERS] drop table inside transactions - Mailing list pgsql-hackers

From ocie@paracel.com
Subject Re: [HACKERS] drop table inside transactions
Date
Msg-id 9804171744.AA27696@dolomite.paracel.com
Whole thread Raw
In response to RE: [HACKERS] drop table inside transactions  ("Meskes, Michael" <meskes@topsystem.de>)
Responses Re: [HACKERS] drop table inside transactions
List pgsql-hackers
Meskes, Michael wrote:
>
> Is this really a bug? I haven't seen any (commercial) system supporting
> this kind of transaction recovery. Once you drop a table the data is
> lost, no matter if you rollback or not.
>
> Michael

I tend to agree.  Sybase will not even honor a drop table request
inside a transaction:

1> begin tran
2> go
1> drop table foo
2> go
Msg 2762, Level 16, State 4:
Line 1:
The 'DROP TABLE' command is not allowed within a multi-statement transaction in
the 'ociedb' database.
1>

We _could_ do something like check a "deleted" flag in the relation
and postpone the actual delete until the transaction is committed, but
at least in my experience, changing table structure is usually best
left to human admins as opposed to applications.  Rows change but the
basic table structure stays the same until the application and schema
are changed.

Ocie

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Proposal for async support in libpq
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Proposal for async support in libpq