From the course: Advanced PostgreSQL
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Rolling back transactions - PostgreSQL Tutorial
From the course: Advanced PostgreSQL
Rolling back transactions
In this movie, we'll see how you can rollback a transaction. We've seen how we can use the commit keyword to commit the changes in our transaction to our table. Rollback will rollback changes. I'm going to insert a new record into the bank accounts table for Jack. Jack contains $1,000 in this account. I'm going to run both of these statements so that after we perform the insertion, we can see the new records in the table. I have Charlie and Dora as before with $99000 and $25,100 and you can see Jack here at the very bottom with $1,000 in this bank account. I'm now going to use a transaction to perform a withdrawal and deposit operation. But before I commit the transaction, I'm going to roll back the changes that I have made. Let's execute this code one command at a time. On line four, I have the begin command. Go ahead and execute it. This will start our transaction. Next, I have an update command that withdraws $1,500 from Jack's bank account. Run this command and then select and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Transactions and transaction isolation levels5m 44s
-
(Locked)
Creating and committing transactions2m 48s
-
(Locked)
Rolling back transactions2m 28s
-
(Locked)
Rolling back committed transactions2m 15s
-
(Locked)
Savepoints and rollbacks2m 36s
-
(Locked)
The read committed isolation level2m 50s
-
(Locked)
The repeatable read isolation level4m 50s
-
(Locked)
The serializable isolation level5m 37s
-
(Locked)
-