0

I am having a hard time with this bulk copy syntax. Looks to me like I followed the correct syntax from a tutorial i checked out. But there seems to be a syntax error that i cannot detect. Need some help on this.

COPY aza_ods_version2.test2 
    FROM {'/Users/kevingitonga/Desktop/test1.csv' | STDIN} 
    [ [ WITH ]
          [ BINARY ]
          [ OIDS ]
          [ DELIMITER [ AS ] ',' ]
          [ CSV [ HEADER ]]
Jon Heller
  • 34,999
  • 6
  • 74
  • 132
Kevin G
  • 119
  • 1
  • 8
  • At my first glance, aren't you missing one `]` at the end ? Here is one useful so link https://stackoverflow.com/questions/32271378/in-postgresql-how-to-insert-data-with-copy-command and the official document https://www.postgresql.org/docs/9.1/sql-copy.html#:~:text=%5Ccopy%20invokes%20COPY%20FROM%20STDIN,specified%20as%20an%20absolute%20path. – Sujitmohanty30 Sep 17 '20 at 19:46
  • The `[` and `]` should **not** be entered - they just document [optional parameters](https://www.postgresql.org/docs/current/notation.html). See [the examples](https://www.postgresql.org/docs/current/sql-copy.html#id-1.9.3.55.10) in the manual –  Sep 18 '20 at 06:36

0 Answers0