skip to Main Content

I have a problem when I try to import a file to PostgreSQL.

I’m using Postgresql 16.3 on Windows but whenever I try to import a new file (.sql) it doesn’t work! My process on Postbird: File -> Import .sql file -> I select my sql file -> Import database -> Error! And it shows me an error that says:

" Import Options Importing File:
C:UsersaorlaDownloadsTheBestOfBaseballAwardsbaseball_dataset.sql
Select database ‘baseball’ psql: authentication method 10 not supported FAILURE "

The error on Postbird

I even tried some other methods, like going to SQL shell directly and try it from there using: "i C:UsersaorlaDownloadsTheBestOfBaseballAwardsbaseball_dataset.sql" but it threw me an error again, saying:

"C:: Permission denied".

I was expecting that this would solve the problem but it didn’t.

Then, I also tried from cmd using this command:

psql --host=localhost --port=5432 --dbname=baseball --username=postgres --files=C:\Users\aorla\Downloads\TheBestOfBaseballAwards\baseball_dataset.sql

And it’s error:

psql: illegal option — files=C:UsersaorlaDownloadsTheBestOfBaseballAwardsbaseball_dataset.sql psql: hint: Try "psql –help" for more information."

3

Answers


  1. The first error means that "Postbird" is using a version of the PostgreSQL client shared library "libpq" that is too old. Upgrade your client software!

    For the other errors, try to specify the path like this:

    /c/Users/aorla/Downloads/...
    
    Login or Signup to reply.
  2. The psql command-line argument you’re after is called --file=, not --files=.

    Additionally, you don’t need to escape backslashes on Windows, and you probably should use double-quotes with --file= just-to-be-safe.

    So change your command-line to this:

    (Literal line-breaks with ^ added for readability btw)

    psql ^
        --host=localhost ^
        --port=5432 ^
        --dbname=baseball ^
        --username=postgres ^
        --file="C:UsersaorlaDownloadsTheBestOfBaseballAwardsbaseball_dataset.sql"
    
    
    Login or Signup to reply.
  3. You have a typo in psql command

    --files ❌ it will be --file

    psql --host=localhost --port=5432 --dbname=baseball --username=postgres --file=C:\Users\aorla\Downloads\TheBestOfBaseballAwards\baseball_dataset.sql
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search