PostgreSQL: Using PSQL, Disable Autocommit Globally

When you are doing bulk operations, probably you require to disable Auto-commit option in PostgreSQL.

When bulk operations are going on at that time commit of individual statement is a very costly operation.

Before you start your bulk operations, you should visit my prepared nice check list for increasing the performance of bulk operations.

PostgreSQL: How to increase the performance of Bulk Insertion (INSERT)

I have found few database developers are finding the solution to disable the auto-commit in PostgreSQL. Once you complete with your task, again you should enable it to make sure about the data durability.

You can do this using PSQL tool and It is very simple:

Login in your PSQL tool and execute below command (It is a case sensitive):

To enable again, execute below command:


Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

2 Comments on "PostgreSQL: Using PSQL, Disable Autocommit Globally"

Notify of
avatar

Sort by:   newest | oldest | most voted
Pisey
Guest
Pisey
1 day 15 hours ago

Hello Anvesh Patel? when i excecuted: set autocommit=off;
ERROR: SET AUTOCOMMIT TO OFF is no longer supported

wpDiscuz