0

I have a syntax error on Postgresql:

The error :

ERROR:  syntax error at or near "\"
LINE 19066: \.
            ^
********** Erreur **********

ERROR: syntax error at or near "\"
État SQL :42601
Caractère : 678313

And the offending line

COPY accesslog (aid, sid, title, path, url, hostname, uid, timer, "timestamp") FROM stdin;
\.

Do you have an idea what's wrong?

4
  • 1
    Why would you not show the actual error? What possible reason can there be for hiding it? Commented Feb 27, 2014 at 15:50
  • Sorry, I indicated the line affected by the error, but not the error in fact, here's the error: ERROR: syntax error at or near "\" LINE 19066: \. ^ ********** Erreur ********** ERROR: syntax error at or near "\" État SQL :42601 Caractère : 678313 Commented Feb 27, 2014 at 16:02
  • 1
    @user3352128 Where are you executing this copy command ? Commented Feb 27, 2014 at 18:26
  • Thank you for your answer Houari. I execute this command in pgadmin, to make a dump of my database Commented Feb 27, 2014 at 19:10

1 Answer 1

1

PgAdmin-III doesn't support interactive line-by-line COPY. Use psql.

That said, I think you are trying to COPY data FROM the server, not to it. If that's the case, either use COPY ... TO 'some-file-name' (a path relative to the database server), use pg_dump, or use psql with \copy.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.