B
B
bruxo2019-10-03 00:22:55
PostgreSQL
bruxo, 2019-10-03 00:22:55

How to import Postgres demo database (demo-big.zip)?

Hello!
How to import demo database into Postgres 11 (demo-big.zip)?
What I did:
1. I downloaded the demo database from the website ( https://postgrespro.ru/education/demodb)
2. I tried the command postgres=# \i <file path> (result: No such file or directory)
3. I tried command psql -h hostname -d databasename -U username -f file.sql , nothing (maybe something was not specified correctly)
4. Used variations: https://stackoverflow.com/questions/6842393/import...
5. Found similar question: How to import a database in postgresql?
How to import Demo database via command line or PgAdmin ?
I would be grateful for the option with an example, i.e., what and where to specify in the command.
I haven't figured it out yet: https://www.postgresql.org/docs/8.1/backup.html#BA...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Bruxo, 2019-10-06
@Bruxo

The command from point No. 2: postgres=# \i [full path to the directory] works only if you place the test database in the root directory "C"
example: postgres=# \i C:/demo_big.sql

H
HelloWorld1488, 2020-09-21
@HelloWorld1488

Everything is written in their brochure: https://edu.postgrespro.ru/introbook_v6.pdf (p. 74-75)
In your case, in the terminal:
$ sudo su - postgres
$ wget https://edu.postgrespro.ru/demo -big.zip
$zcat demo-big.zip | psql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question