Transaction control comes under the common things that need to be kept in mind while working with the database. This recipe will show you how to handle the transaction with the help of the sql package.
Handling transactions
Getting ready
Verify if Go is properly installed by calling the go version command in your Terminal. If the command fails, follow the Getting ready section in the first recipe of this chapter.
Set up the PostgreSQL server, as mentioned in the first recipe of this chapter.
How to do it...
- Run the following SQL script against your sample database: