Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL Commit

Transaction Control:
There are following commands used to control transactions:
  • BEGIN TRANSACTION: to start a transaction.
  • COMMIT: to save the changes, alternatively you can use END TRANSACTION command.
  • ROLLBACK: to rollback the changes.
Transactional control commands are only used with the DML commands INSERT, UPDATE and DELETE only. They can not be used while creating tables or dropping them because these operations are automatically committed in the database.

The BEGIN TRANSACTION Command:
Transactions can be started using BEGIN TRANSACTION or simply BEGIN command. Such transactions usually persist until the next COMMIT or ROLLBACK command is encountered. But a transaction will also ROLLBACK if the database is closed or if an error occurs.

Following is the simple syntax to start a transaction:
BEGIN;
or
BEGIN TRANSACTION;
The COMMIT Command:
  • The COMMIT command is the transactional command used to save changes invoked by a transaction to the database.
  • The COMMIT command saves all transactions to the database since the last COMMIT or ROLLBACK command.
The syntax for COMMIT command is as follows:
COMMIT;
or
END TRANSACTION;


Comments

Popular posts from this blog

Oracle DBMS SCHEDULER Examples

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

7 Steps to configure BDR replication in postgresql

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

vacuumlo - removing large objects orphans from a database PostgreSQL