Re: [HACKERS] DROP TABLE inside transaction block - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] DROP TABLE inside transaction block
Date
Msg-id 37D3145B.9179323E@krs.ru
Whole thread Raw
In response to DROP TABLE inside transaction block  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] DROP TABLE inside transaction block
List pgsql-hackers
Tom Lane wrote:
> 
> Pursuant to a phone conversation I had with Bruce, I added code this
> morning to reject DROP TABLE or DROP INDEX inside a transaction block;
> that is, you can't do BEGIN; DROP TABLE foo; END anymore.  The reason
> for rejecting this case is that we do the wrong thing if the transaction
> is later aborted.  Following BEGIN; DROP TABLE foo; ABORT, the system
> tables will claim that foo is still valid (since the changes to them
> were never committed) but we've already unlinked foo's physical file,
> and we can't get it back.  Solution: only allow DROP TABLE outside
> BEGIN, so that the user can't try to change his mind later.

What if table was created inside BEGIN/END?
Any reason to disallow DROP of local tables?

Vadim


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] md.c is feeling much better now, thank you
Next
From: Thomas Lockhart
Date:
Subject: [HACKERS] main tree is (slightly) damaged