Begins a transaction block, creates a table, and commits the action : COMMIT « Transaction « PostgreSQL






Begins a transaction block, creates a table, and commits the action

postgres=#
postgres=# -- Begins a transaction block, creates a table, and commits the action:
postgres=#
postgres=# BEGIN WORK;
WARNING:  there is already a transaction in progress
BEGIN
postgres=#
postgres=# CREATE TABLE test (id integer, name text);
CREATE TABLE
postgres=#
postgres=# COMMIT WORK;
COMMIT
postgres=#
postgres=#
postgres=# BEGIN WORK;
BEGIN
postgres=#
postgres=# drop table test;
DROP TABLE
postgres=# COMMIT WORK;
COMMIT
postgres=#
postgres=#

           
       








Related examples in the same category

1.Committing a transaction