From: svilen@iname.com
To: Duncan Adams (DNS) <duncan.adams@vcontractor.co.za>
Cc: postgres sql list <pgsql-sql@postgresql.org>
Subject: Re: copy command
Date: Thu, 25 Apr 2002 17:39:53 -0700
Message-ID: <200204260037.g3Q0bmh212070@pimout2-int.prodigy.net> (raw)
In-Reply-To: <7DD34E6DF5CD1B4283DDAB96A855DCED2F3285@vodabemail1.vodacom.co.za>
Hello!
You only need to put an "\" in front of "copy". It is an internal command. And you don't need ";" at the end
it would be:
bpsimple=# \copy dns_ip from 'dns.txt'
\.
bpsimple=# SELECT * FROM dns_ip;
dns | ip
---------+---------------
aeomc04 | 10.121.4.157
somcmd1 | 10.121.23.57
aeomc05 | 10.121.4.162
gsmomc6 | 10.121.4.154
(4 rows)
\. is the response and tells you that it worked.
I actually tried it with "\copy dns_ip from dns.txt", without the
quotes and it also worked perfectly.
Svilen Dyakovski
On 25 Apr 02, at 16:53, Duncan Adams (DNS) wrote:
>
> 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=>
> wire_dev=> \d dns_ip
> Table "dns_ip"
> Attribute | Type | Modifier
> -----------+-----------------------+----------
> dns | character varying(32) |
> ip | character varying(32) |
>
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: svilen@iname.com, duncan.adams@vcontractor.co.za
Subject: Re: copy command
In-Reply-To: <200204260037.g3Q0bmh212070@pimout2-int.prodigy.net>
* 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