"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