While working with the database, the basic part is the extraction of data through executed query. This recipe will illustrate how it is done when using the standard library database/sql package.
Retrieving data from a query result
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...