Re: copy command

Поиск
Список
Период
Сортировка
От svilen@iname.com
Тема Re: copy command
Дата
Msg-id 200204260037.g3Q0bmh212070@pimout2-int.prodigy.net
обсуждение исходный текст
Ответ на copy command  ("Duncan Adams (DNS)" <duncan.adams@vcontractor.co.za>)
Список pgsql-sql
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.157somcmd1 | 10.121.23.57aeomc05 | 10.121.4.162gsmomc6 | 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) |
> 



В списке pgsql-sql по дате отправления:

Предыдущее
От: Bill Cunningham
Дата:
Сообщение: Re: HAVING - clause
Следующее
От: Rajesh Kumar Mallah
Дата:
Сообщение: Re: Database Server in Recovery mode!