PG: 使用中,可以含DDL命令。如下:
postgres@:5432/postgres-2414#=begin;
BEGIN
postgres@:5432/postgres-2414#=create table xx(id numeric);
CREATE TABLE
postgres@:5432/postgres-2414#=insert into xx values(10);
INSERT 0 1
postgres@:5432/postgres-2414#=\d
List of relations
Schema | Name | Type | Owner
--------+-------------------------+-------+----------
public | log_student | table | postgres
public | pg_buffercache | view | postgres
public | pg_stat_statements | view | postgres
public | pg_stat_statements_info | view | postgres
public | score | table | postgres
public | student | table | postgres
public | t | table | postgres
public | test | table | postgres
public | xx | table | postgres
(9 rows)
postgres@:5432/postgres-2414#=rollback;
ROLLBACK
postgres@:5432/postgres-2414#=\d
List of relations
Schema | Name | Type | Owner
--------+-------------------------+-------+----------
public | log_student | table | postgres
public | pg_buffercache | view | postgres
public | pg_stat_statements | view | postgres
public | pg_stat_statements_info | view | postgres
public | score | table | postgres
public | student | table | postgres
public | t | table | postgres
public | test | table | postgres
(8 rows)