Reputation: 1785
I use a batch file to copy data from a database to other like this:
SET PGPASSWORD=passtest
"C:\Program Files\e-SUS\database\postgresql-9.6.13-4-windows-x64\bin\psql.exe" -h 10.10.10.10 -p 5433 -d esus -U postgres -c "\copy (SELECT * from mytable) to 'e:\data.csv' with csv header"
IF EXIST e:\data.csv ( "C:\Program Files\e-SUS\database\postgresql-9.6.13-4-windows-x64\bin\psql.exe" -h 11.11.11.11 -p 5433 -d esus -U postgres -c "\copy mytable from 'e:\data.csv' with csv header delimiter ','" )
this works correctly, but if my password have a asterisk character like SET PGPASSWORD=pass*test
this not works... I try to use SET PGPASSWORD=pass%*test
but this not works too.
Any idea?
Upvotes: 1
Views: 880