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

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

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

Oracle to Postgresql migration

PostgreSQL Enterprise Manager - PEM Monitoring Tools

7 Steps to configure BDR replication in postgresql