Sam
Sam

Reputation: 19

WARNING: nonstandard use of escape in a string literal

I have installed source code of Postgres version 8.4.18, I am trying to create a table from .CSV file. (picture)

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.

Picture2

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

Upvotes: 1

Views: 220

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246123

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.

Upvotes: 2

Related Questions