Download and load PostgreSQL sample database

In this article, we will see download and load PostgreSQL sample database. PostgreSQL sample database is used for practice purpose only.
We can download the PostgreSQL sample database dvdrental from the github

Download and load PostgreSQL sample database:

1. Go to link https://github.com/robconery/dvdrental.

2. Create database with the name dvdrental from either Linux shell or psql shell.

From Linux shell

createdb dvdrental

From psql shell:

create database dvdrental;

3. From the Linux shell navigate to Downloads directory and execute below restore command.

pg_restore -d dvdrental dvdrental.tar

4. Then, connect to psql shell and run below command to verify PostgreSQL sample database loaded or not.

select * from pg_database where datname='dvdrental';

or

\l dvdrental