Re: [HACKERS] md.c is feeling much better now, thank you - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] md.c is feeling much better now, thank you
Date
Msg-id 12545.936370008@sss.pgh.pa.us
Whole thread Raw
In response to RE: [HACKERS] md.c is feeling much better now, thank you  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses Re: [HACKERS] md.c is feeling much better now, thank you  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> Hmm,Data Define commands are unrecoverable in many DBMS-s. 

True.

> For example,should the following be possible ?

> [A table t exists.]

> begin;
> drop table t;
> create table t (dt int4);
> insert into t values (1);
> drop table t;
> abort;

I don't mind if that is rejected --- but it ought to be rejected
cleanly, rather than leaving a broken table behind.

IIRC, it is fairly easy to tell from the xact.c state whether we are
inside a BEGIN block.  Maybe DROP TABLE and anything else that has
nonreversible side effects ought to simply elog(ERROR) if called inside
a BEGIN block.  We'd need to be a little careful though, since I think
DROP TABLE on a temp table created in the same transaction ought to
work.
        regards, tom lane


pgsql-hackers by date:

Previous
From: José Soares
Date:
Subject: Re: [HACKERS] SELECT BUG
Next
From: Thomas Lockhart
Date:
Subject: main tree is (slightly) damaged