2

I'm trying to execute the Postgres COPY command.

COPY warehouse_terminal.test_table FROM 'C:\file.csv' DELIMITERS E'\t'
     CSV HEADER QUOTE E'\"' ESCAPE E'\\' NULL AS '';

The problem is, the db where I'm going to use this is remote, and the file "file.csv" is in my local machine in C:\. As a result, the file is not read.
Remote db, but local file. How can I get this working?

Erwin Brandstetter
  • 479,275
  • 111
  • 893
  • 1,042
muffin
  • 1,832
  • 7
  • 37
  • 75

1 Answers1

6

Use \copy of the psql client on your local machine, it's a wrapper for COPY for just this purpose.

More details:

Community
  • 1
  • 1
Erwin Brandstetter
  • 479,275
  • 111
  • 893
  • 1,042