Mike
Mike

Reputation: 344

pgAdmin4 import file error - can't find file

I'm having a problem importing a csv file to pgAdmin4 on a mac - it simply can't find the file. This is so simple that I'm hoping there's just a setting I've failed to set up.

In the import/export data function on a table, there is the Import/Export dialog that looks like this: enter image description here

However, it can't find the file: enter image description here

That error looks like the standard python error when you give it the wrong path to a file. But it's correct - that's where the file is: '/tmp/person616.csv' - I didn't even enter the name/path, I browsed to it.

Has this happened to anybody else? Know how to fix it?

Upvotes: 7

Views: 12860

Answers (5)

Steph
Steph

Reputation: 115

Right click on table > import/export > Toggle "Import" mode > select file > Upload Files then select each for every table

how to import files on pgAdmin 4

Upvotes: 0

Victor Valeanu
Victor Valeanu

Reputation: 438

In pgAdmin, when you right-click on a database and click Restore, in the bottom-right corner of the mini-interface, just above the Select button, you can see Format 'dorpdown-list'. Make sure that the drop-down list isn't limiting your displayed files, so select All Files.

Upvotes: 0

Pritam Banik
Pritam Banik

Reputation: 121

The exact problem has been bothering me for quite some days now. There are not much resources available to address it. So here's what I did:

  1. I created a new folder giving it a strange name making sure that it is unique under the "/" directory and in the pgAdmin4 panel you're in rn.

  2. I used below commands to find the new strange named folder that I just created: (i) sudo su (ii) find -iname [strange named folder] -type d

  3. And after some time here it was. My path was revealed.

In my case, the path was /var/lib/pgadmin/storage/[pgAdmin4_username]

Upvotes: 9

Bret Hess
Bret Hess

Reputation: 503

I just had the same problem and found the solution. PGAdmin4's root directory is not your root directory. It starts at

/home/[your_username]/.pgadmin/storage/[your PGAdmin_username]/

So if you put your file or backup directories there, it can find the files.

It also helps to have it show "all" files in the backup dialog, so it can find files with your own extensions. e.g. I use `filename.custom' which it doesn't recognize.

Upvotes: 1

Murtuza Z
Murtuza Z

Reputation: 6017

I suspect that path for "PostgreSQL Binary Path" is not set properly in pgAdmin4.

In pgAdmin4 Goto:

File > Preferences > Paths > Binary paths > PostgreSQL Binary Path

Sample paths as below (You need to change it according to your Postgres location),

If you are using Windows than provide path like,

C:\Program Files\PostgreSQL\9.6\bin

If you are using Linux than provide path like,

/opt/PostgreSQL/9.5/bin

If you are using Mac than provide path where you have installed PG,

/Library/PostgreSQL/9.6/bin

And try again.

Upvotes: 1

Related Questions