db restore from sql file

From: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
To: pgadmin-support(at)lists(dot)postgresql(dot)org
Subject: db restore from sql file
Date: 2021-02-19 20:00:13
Message-ID: 48d16f226efaca5ec09c4f39bc85b1e9.squirrel@webmail.harte-lyne.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

I used pgadmin4 to create a dump file in plain sql.

I am trying to use this file to populate a test database on another postgresql
host. I can find the file previously created. It appears correct:

[root(at)vhost01 ~ (master)]# file
/var/db/pgadmin4/storage/admin_harte-lyne.ca/redmine_backup_locate.sql
/var/db/pgadmin4/storage/admin_harte-lyne.ca/redmine_backup_locate.sql: ASCII
text, with very long lines

[root(at)vhost01 ~ (master)]# more
/var/db/pgadmin4/storage/admin_harte-lyne.ca/redmine_backup_locate.sql
--
-- PostgreSQL database dump
--

-- Dumped from database version 9.6.17
-- Dumped by pg_dump version 12.5

-- Started on 2021-02-19 14:32:31 EST

SET statement_timeout = 0;
SET lock_timeout = 0;
. . .

The target database exists on the target host. However, when I try to run the
restore function in pgadmin4 I get this error:

/usr/local/bin/pg_restore --host "pgsql-dbms.internal.hamilton.harte-lyne.ca"
--port "5432" --username "postgres" --no-password --role "postgres" --dbname
"hll_redmine_copy" --verbose
"/var/db/pgadmin4/storage/admin_harte-lyne.ca/redmine_backup_locate.sql

pg_restore: error: input file appears to be a text format dump. Please use psql

Is there no way to restore from an sql file from within pgadmin4?

--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Unencrypted messages have no legal claim to privacy
Do NOT open attachments nor follow links sent by e-Mail

James B. Byrne mailto:ByrneJB(at)Harte-Lyne(dot)ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message James B. Byrne 2021-02-19 20:04:27 Re: db restore from sql file
Previous Message James B. Byrne 2021-02-19 14:57:35 Re: pgadmin-4.30 upgrade from 4.27