I'm un running PostgreSQL version 11.8 in Windows Server 2016, and in PostgreSQL shell, I'm trying to import a dump database file that was exported using PostgreSQL version 8.4.20. However, get error as "database ... does not exist" Using Windows Dos command prompt, tried:
c:\Program Files\PostgreSQL\11\bin> pg_dump -U postgres C:\folderName\databaseName.dump > C:\AnotherFolderName\databasenew.sql
However, get an error as:
pg_dump: [archiver (db) connection to database C:\folderName\databaseName.dump" failed: FATAL "C:\folderName\databaseName.dump" does not exist
Also, I tried removing the .dump extension as follows:
c:\Program Files\PostgreSQL\11\bin> pg_dump -U postgres C:\folderName\databaseName > C:\AnotherFolderName\databasenew2.sql
and get error, too:
pg_dump: [archiver (db) connection to database C:\folderName\databaseName" failed: FATAL "C:\folderName\databaseName" does not exist
pg_dump(or any Postgres command line tool) To get a list of available database names usepsql -l. To "import" a SQL ("plain text") dump, you need to usepsql -d database_name -f databasenew2.sqlsee the manual for detailspg_restore -f C:\AnotherFolderName\databasenew.sql C:\folderName\databaseName.dump? This will only work ifC:\folderName\databaseName.dumpwas created using a custom format. If the dump file is a text file you will need to usepsql.psql -d database_name -f databasenew2.sqlto import the dump. See the manual for detailsC:\Program Files\PostgreSQL\11\bin> psql -U postgresNext, entered password for postgres. In postgres=#, ranpsql -d databaseName.dump -f databasenew.sql. Then, returns topostgres=#prompt. PgAdmin UI does not show the "databasenew"