I have installed source code of Postgres version 8.4.18, I am trying to create a table from .CSV file.
I have created a table successfully when, I am trying to copy the location with command COPY population from 'C:\Users\xyz\Desktop\Data8277.csv' WITH CSV HEADER; i get the following error.
WARNING: nonstandard use of escape in a string literal
LINE 1: COPY population from 'C:\Users\xyz\Desk...
^
HINT: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: could not open file "C:UsersxyzDesktop-Data8277.csv" for reading: No such file or directory.
Unable to sort this problem out
CodePudding user response:
Set the parameter standard_conforming_strings
to on
, so that backslash in string literals is treated as a normal character. I hope you aren't using an ancient version like that for anything but for preparing an upgrade.
CodePudding user response:
Added standard_conforming_strings to on, When I run copy command, COPY population from 'C:\Users\xyz\Desktop\Data8277.csv' WITH CSV HEADER; i get the following error:
ERROR: could not open file "C:\Users\xyz\Desktop\Data8277.csv" for reading: No such file or directory