Is there a way to use 'COPY' command(PostgreSQL) in windows cli?
You have the right command (COPY
), but you need to begin an interactive session with Postgres if you want use the COPY
command from the Windows command line.
psql -U username yourdb
This should leave you at a prompt looking like the following:
yourdb=#
Now you can use the COPY
command and it should work:
COPY myTable FROM value.txt (DELIMITER('|'))
The problem you were having is that COPY
is not a Windows executable program, it is a Postgres command which is only understood by Postgres.