pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Klas Stockhem <Klas.Stockhem@benders.se>
Cc: PostgreSQL <pgsql-sql@postgresql.org>
Subject: Re: Problems when copy data from dump file
Date: Tue, 04 Aug 2009 14:26:40 +0100
Message-ID: <4A783710.6080207@archonet.com> (raw)
In-Reply-To: <2A250781A3744D48B1529FCC3C2EB8ABCB47A1@comserver.benders.se>
References: <2A250781A3744D48B1529FCC3C2EB8ABCB47A1@comserver.benders.se>

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;
1<tab>Title one<tab>Some text
2<tab>Title two<tab>Some text
\.

Where the <tab> 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



view thread (9+ messages)  latest in thread

Message-ID: <4A783710.6080207@archonet.com>
Permalink:  ../4A783710.6080207@archonet.com/
Also on:    postgresql.org/message-id/4A783710.6080207@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, Klas.Stockhem@benders.se
  Subject: Re: Problems when copy data from dump file
  In-Reply-To: <4A783710.6080207@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox