Skip site navigation (1) Skip section navigation (2)

Re: copy command

From: "ARP" <arnaud(dot)mlist1(at)free(dot)fr>
To: "Duncan Adams (DNS)" <duncan(dot)adams(at)vcontractor(dot)co(dot)za>,"postgres sql list" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: copy command
Date: 2002-04-25 18:34:09
Message-ID: 008401c1ec87$ced6ac80$ (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
I think you need the quote around the file name since it's not a keyword and it's text.
Then your dns.txt file needs to be formated correctly, especially concerning the separator : by default I think TABs are used and \N is used to say NULL. You can go aver that with USING DELIMITERS ';' for example and WITH NULL AS '' if your dns.txt look like this :

hope this helps

----- Original Message ----- 
From: "Duncan Adams (DNS)" <duncan(dot)adams(at)vcontractor(dot)co(dot)za>
To: "postgres sql list" <pgsql-sql(at)postgresql(dot)org>
Sent: Thursday, April 25, 2002 4:53 PM
Subject: [SQL] copy command

hi all

how do you use the copy command
call me dumb, i have RTFM but i don't seem to get it.

an exstract from my dns.txt file.


wire_dev=> copy dns_ip from dns.txt
wire_dev-> ;
ERROR:  parser: parse error at or near "dns"
wire_dev=> copy dns_ip from /database/pgsql/dns.txt
wire_dev-> ;
ERROR:  parser: parse error at or near "/"
wire_dev=> \d dns_ip
                Table "dns_ip"
 Attribute |         Type          | Modifier
 dns       | character varying(32) |
 ip        | character varying(32) |


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

  • copy command at 2002-04-25 14:53:06 from Duncan Adams (DNS)

pgsql-sql by date

Next:From: Bill CunninghamDate: 2002-04-25 18:51:03
Subject: Re: HAVING - clause
Previous:From: Brubaker, ShaneDate: 2002-04-25 17:25:50
Subject: Collection of PostgreSQL Performance Tips

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group