Re: Problems when copy data from dump file - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Problems when copy data from dump file
Date
Msg-id 4A77EC9F.1020202@archonet.com
Whole thread Raw
In response to Problems when copy data from dump file  ("Klas Stockhem" <Klas.Stockhem@benders.se>)
List pgsql-sql
Klas Stockhem wrote:
> SQL error:
> 
> ERROR:  syntax error at or near "5"
> 
> LINE 2: 5 Slitasje og vedlikehold PRAKTISKE OPPLYSNINGER\r\n\r\nSn&#...
> 
>         ^

> COPY artikkel (id, tittel, tekst) FROM stdin;
> 
> 5                    Slitasje og vedlikehold            PRAKTISKE
> OPPLYSNINGER\r\n\r\nSnø og is.\r\nSnør...and more text... \.

1. Do you really have a blank line between "COPY" and "5"? If so, that's 
your problem.
2. Are you perhaps copying+pasting from a Windows machine to a Linux one 
or similar? You might be getting "\r\n" at the end of lines when it's 
expecting "\n".

> The postgresql version is 7.4.17.

Might want to set aside some time to upgrade in the near future - you're 
missing four full versions since 2003. At the very least, upgrade to 
7.4.25 at your earliest convenience.

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Create table command fails with permission denied
Next
From: Richard Huxton
Date:
Subject: Re: Problems when copy data from dump file