Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E6D83633AB9 for ; Tue, 4 Aug 2009 05:36:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 00745-06 for ; Tue, 4 Aug 2009 08:36:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.pcl-ipout01.plus.net (relay.pcl-ipout01.plus.net [212.159.7.99]) by mail.postgresql.org (Postfix) with ESMTP id 1E762633A42 for ; Tue, 4 Aug 2009 05:36:23 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAM6Pd0rUnw6R/2dsb2JhbADUO4QYBQ Received: from ptb-relay01.plus.net ([212.159.14.145]) by relay.pcl-ipout01.plus.net with ESMTP; 04 Aug 2009 09:36:21 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by ptb-relay01.plus.net with esmtp (Exim) id 1MYFVN-0002ER-Ck; Tue, 04 Aug 2009 09:36:21 +0100 Received: from dell36.office.archonet.com (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 557BC274075; Tue, 4 Aug 2009 09:09:03 +0100 (BST) Message-ID: <4A77EC9F.1020202@archonet.com> Date: Tue, 04 Aug 2009 09:09:03 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Klas Stockhem CC: pgsql-sql@postgresql.org Subject: Re: Problems when copy data from dump file References: <2A250781A3744D48B1529FCC3C2EB8ABCB465E@comserver.benders.se> In-Reply-To: <2A250781A3744D48B1529FCC3C2EB8ABCB465E@comserver.benders.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: 20ee58e0a11d3be916d54ed96dcb7dbc X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.594 tagged_above=-10 required=5 tests=AWL=1.005, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/11 X-Sequence-Number: 32920 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