Working with Postgres 12 / Windows 10.
Trying to copy a remote database to localhost with the following command:
pg_dump -C -h remotehost -p 5432 -U postgres remotedb | psql -h localhost -p 5432 -U postgres localdb
CMD requests for password 2x.
Password for user postgres: Password:
I input localhost first, hit ENTER, then input remotehost and hit ENTER again.
This is the error I get in return:
SET
SET
SET
SET
SET
set_config
------------
(1 row)
SET
SET
SET
SET
ERROR: option "locale" not recognized
LINE 1: ...ting" WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = '...
^
ERROR: database "remotedb" does not exist
\connect: FATAL: database "remotedb" does not exist
pg_dump: error: could not write to output file: Broken pipe
- How to solve 1st error 'option "locale" not recognized"?
- Is the 2nd error related to how I input the passwords? How should I work when both databases request for passwords?
localeoption in thecreate databasestatement: postgresql.org/docs/12/sql-createdatabase.html but 13 have: postgresql.org/docs/13/sql-createdatabase.html Remove-Coption frompg_dumpand create database by hands.-Cand creating the database manually worked perfectly, and it didn't have anything to do with the way I was inputting the password.