Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id E8D0D632B86 for ; Tue, 4 Aug 2009 10:26:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 00405-03 for ; Tue, 4 Aug 2009 13:26:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by mail.postgresql.org (Postfix) with ESMTP id 4BA64632B08 for ; Tue, 4 Aug 2009 10:26:45 -0300 (ADT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAPUd0rUnw6U/2dsb2JhbADUc4QYBYIy Received: from fhw-relay07.plus.net ([212.159.14.148]) by relay.ptn-ipout02.plus.net with ESMTP; 04 Aug 2009 14:26:41 +0100 Received: from [84.51.143.99] (helo=server3.office.archonet.com) by fhw-relay07.plus.net with esmtp (Exim) id 1MYK2L-0006xN-EH; Tue, 04 Aug 2009 14:26:41 +0100 Received: from dell36.office.archonet.com (dell36.office.archonet.com [192.168.1.36]) by server3.office.archonet.com (Postfix) with ESMTP id 3B1F327406C; Tue, 4 Aug 2009 14:26:41 +0100 (BST) Message-ID: <4A783710.6080207@archonet.com> Date: Tue, 04 Aug 2009 14:26:40 +0100 From: Richard Huxton User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Klas Stockhem CC: PostgreSQL Subject: Re: Problems when copy data from dump file References: <2A250781A3744D48B1529FCC3C2EB8ABCB47A1@comserver.benders.se> In-Reply-To: <2A250781A3744D48B1529FCC3C2EB8ABCB47A1@comserver.benders.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Plusnet-Relay: e844840c398c35df53a09817a9c2a965 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200908/12 X-Sequence-Number: 32921 Klas Stockhem wrote: > Thanks for your mail! Remember to cc: the mailing list too. Just hit "reply to all". Oh, and perhaps don't top-quote. It makes it difficult for others to follow the message. > 1. Yes, the 5 and other text are at line 2 (a new line). I tried to put > the whole command on the first line and execute it but I get same error: > > > ERROR: syntax error at or near "1" > LINE 1: COPY artikkel (id, tittel, tekst) FROM stdin 1 test test; No, the data needs to start on the line below COPY, but your first email had a blank line there. Your message had: Line 1: COPY artikkel (id, tittel, tekst) FROM stdin; Line 2: (blank) Line 3: 5 Slitasje og vedlikehold PRAKTISKE OPPLYSNINGER What you want is something like: COPY artikkel (id, tittel, tekst) FROM stdin; 1Title oneSome text 2Title twoSome text \. Where the marks are real tabs. > I have also separated the 1 and the "test-text" with tab. Is the syntax > for the line 1 correct? I have read some about using DELIMITER. Do you > have a suggestion how a can use this in the command? > > 2. Yes I have opened the dump file on in a windows system and copy+paste > it into the phppgadmin web interface. Hmm - reading the phppgadmin documentation, the FAQ says the following: "Only uploaded SQL scripts can contain COPY commands and for this to work, you must have PHP 4.2 or higher." So - it looks like you should save the COPY script to a text-file and upload it. I don't know how you do that, but it should be in the manual. -- Richard Huxton Archonet Ltd