In Postgresql, sometimes we need a sample database when we test. We can use pagila in postgresql.org for this.
You can follow the steps below to install Pagilla.
We’re running the following command to load Pagila’s files.
yum install pagila
As you can see above, pagila files were created. Let’s see where it is now.
First, we execute the following command.
Then we are looking for the package with the help of the following command.
find / -name 'pagila*';
We saw the path where the files of pagila are found. Now let’s install them. We’re connecting to postgres for this.
psql -U postgres
We are connected with the Postgres user and now we create a pagila database and upload the files in the directories.
create database pagila;
After our Pagila database has been created, we connect to the pagila database by typing
"\c pagila" and do the following operations respectively.
Objects like scheme, table, type, domain, function are created below.
We are loading the data with the help of the insert script to the tables created above.
Running the alter command in the tables and loading the data with the copy command.
We have created database and insert data into it. You can check the size of the database with the
"\l+" command by connecting to psql.