Pgadmin 4 pg_restore: [archiver] input file appears to be a text format dump. Please use psql
Asked Answered
E

1

6

Hi I am using Postgres 11 and pgadmin 4.1. I have a SQL file i am trying to import in my newly created database in pgadmin 4.

I know its a generalized error but I tried my best to resolve it, but not working for me.

Here is the error:

enter image description here

Here are a few SQL file lines.

enter image description here

Emaemaciate answered 1/2, 2019 at 6:17 Comment(0)
C
2

There are two things in a plain text dump that may prevent it being restored using the query tool og pgAdmin:

  • backslash commands, like the \connect you get if you use the --create option of pg_dump (only psql understands these)

  • COPY commands to load the data, because pgAdmin does not support mixing SQL and data the way that psql does

So if the dump was created without --create and with either --schema-only or --inserts, it will probably load fine.

Chirlin answered 1/2, 2019 at 6:53 Comment(2)
Doesn't solve the problem in my case, as automated pgadmin dump does contain backslash command; and strangely pgadmin dump as sql cannot be restored.Taxidermy
@Taxidermy My answer was incomplete. I have improved it.Chirlin

© 2022 - 2024 — McMap. All rights reserved.