DDL and transactions

Started by sadover 22 years ago2 messagesbugs
Jump to latest
#1sad
sad@bankir.ru

Why does a DDL command starts a transaction ?!

try
# set autommit=off;
SET
# create table a (i int);
CREATE TABLE
# create table b (i int);
ERROR: current transaction is aborted, queries ignored until end of
transaction block
# commit;
COMMIT
# create table b (i int);
CREATE TABLE
# \d
List of relations
Schema | Name | Type | Owner
----------+---------------+-----------+-------
public | a | table | pgsql
public | b | sequence | pgsql

Dont you find curious a commiting of a DDL ?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: sad (#1)
Re: DDL and transactions

sad <sad@bankir.ru> writes:

Dont you find curious a commiting of a DDL ?

Only to someone who's used to inferior databases that cannot roll back
DDL commands.

regards, tom lane