dbeaver icon indicating copy to clipboard operation
dbeaver copied to clipboard

pg_restore: [archiver] input file appears to be a text format dump. Please use psql.

Open erlangparasu opened this issue 7 years ago • 16 comments

Bug report

C:\Program Files\PostgreSQL\10\bin\pg_restore.exe --verbose --host=127.0.0.1 --port=5432 --username=postgres --dbname=db_1
Restore started at Mon Aug 13 13:36:02 SGT 2018
pg_restore: [archiver] input file appears to be a text format dump. Please use psql.
Restore finished at Mon Aug 13 13:36:03 SGT 2018
The pipe has been ended
Process exit code: 1

erlangparasu avatar Aug 13 '18 05:08 erlangparasu

OS: Windows DBeaver version: 5.1.5

in window Restore Settings, i select Format: Plain

erlangparasu avatar Aug 13 '18 05:08 erlangparasu

pg_restore can't import plain SQL files. Its a job for psql. Also it is possible to run SQL dump as script in DBeaver.

serge-rider avatar Aug 13 '18 09:08 serge-rider

why does dbeaver allow a SQL export that it cannot import it if that is just a matter of using psql instead of pg_restore ? Sounds like an easy fix to me !

mlarcher avatar Apr 13 '20 09:04 mlarcher

+1 to this.

Karkunow avatar Apr 28 '20 10:04 Karkunow

any news?

MikePryadko avatar Aug 17 '20 17:08 MikePryadko

found this confusing as well - the dialog is structured in a way that it seems perfectly fine:

grafik

swiffer avatar Apr 13 '21 17:04 swiffer

Still having this issue nowadays.

Messhias avatar Oct 06 '21 16:10 Messhias

Doing it on the terminal worked for me

image

xmark is the name of the database, the text after < is the location of the dump.

RenatoLopes771 avatar Oct 20 '21 12:10 RenatoLopes771

I ran into the same issue here. The problem is that Export with "Plain" format exports it in plain SQL script format however Import with the "Plain" format tried to load the sql script using pg_restore which does not support importing of plain sql file format and hence we see the error "input file appears to be a text format dump. Please use psql".

In order to restore the "Plain" format export, one needs to use the Tools --> Execute Script option and point to the exported SQL file.

Definitely confusing that DBeaver "Plain" export cannot be loaded using the "Plain" Import setting. It should internally be using "psql" when trying to Import using Plain format.

sjivan avatar Dec 30 '21 03:12 sjivan

Which then begs the question, what does "Plain" import even do, if it's not for importing "Plain" sql dumps?

KBSchmidt avatar Jan 11 '22 12:01 KBSchmidt

Still an issue ~4.5yrs later… ffs at least make the UI consistent with the (lack of) functionality!

toastyghost avatar Apr 07 '23 13:04 toastyghost

Focus and chatGPT and AI but such a simple problem is forgotten.

prhost avatar Apr 10 '23 17:04 prhost

Same on MacOS version (23.0.3.202304240630).

artyhedgehog avatar Oct 18 '23 10:10 artyhedgehog

i think dbeaver should support at least choose between pg_restore or psql if the file type cannot automatically detected

erlangparasu avatar Oct 18 '23 22:10 erlangparasu

Release 24.0.2.202404071654 (April 8 2024) with same problem. No news?

trombini77 avatar Apr 11 '24 13:04 trombini77

Still encountering the same problem nowaday. Thank this threads

Tuanshu avatar Jun 26 '24 02:06 Tuanshu

@serge-rider any thought on this? I confirm it's a bit frustrating since it takes time to figure it out.

EDIT: To make it working either choose tar format when doing the backup, but I noticed a few relationship errors during the import. Or use custom and suffix the backup name with something like .db. pg_restore knows how to manage both.

sneko avatar Sep 19 '24 12:09 sneko

After years, still facing the same issue

SwapnilSoni1999 avatar Sep 26 '24 20:09 SwapnilSoni1999

Please let us use psql instead of pg_restore.

KhanhHH avatar Nov 18 '24 10:11 KhanhHH

@serge-rider any thought on this? I confirm it's a bit frustrating since it takes time to figure it out.

EDIT: To make it working either choose tar format when doing the backup, but I noticed a few relationship errors during the import. Or use custom and suffix the backup name with something like .db. pg_restore knows how to manage both.

Thanks, I used custom prefix and saved my db as .db then the restore worked

raphaelbadia avatar Jan 14 '25 16:01 raphaelbadia

Use Tools>"Script Execution" and select the dump file:

Image

fchiri avatar Mar 07 '25 16:03 fchiri