h8/employees-database

Loading to postgres

Opened this issue · 1 comments

Hello,

I am not able to load test file into Postgres. Can you please help how to include this database into psql?

Many thanks

The following works via the command line on Windows for Postgres 12, and should work on Linux very similarly:

# Grab employees_data.sql.bz2 and decompress it with `bzip2 -d employees_data.sql.bz2` or your favorite compatible archive tool

# Set (or export) environment variables for greater ease (else add them on the command line as appropriate):
set PGHOST=localhost
set PGUSER=postgres
set PGPASSWORD=<postgres password>

# Remove the old DB if present
dropdb --if-exists employees_sample

# Create the new DB
createdb -O postgres -E UTF-8 employees_sample

# Import the data to the new DB
psql employees_sample < employees_data.sql