D
D
Danil Samodurov2021-06-25 17:19:52
PostgreSQL
Danil Samodurov, 2021-06-25 17:19:52

How to create database from sql file?

Hello. I downloaded a demo database from https://postgrespro.ru/education/demodb . But I don't know how to add it now. The zip file is sql. On one machine, I simply executed a sql query by inserting the syntax from this file. It didn't work on another computer. I am using pgAdmin.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
ky0, 2021-06-25
@ky0

The documentation says the following :

The files contain an SQL script that creates the demo database and fills it with data (in fact, this is a backup created by the pg_dump utility). Please note that during the installation, the existing demo database will be deleted and recreated! The demo database will be owned by the DBMS user who executed the script.

A dump created with pg_dumprestores using the pg_restore.
Throw out pgadmin, don't get used to bad things.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question