Thread: \copy not importing in 702...

\copy not importing in 702...

From
Anand Raman
Date:
hi guys

I am having a strange problem with \copy ..
When i am trying to copy from the a csv file \copy doesnt report any
error and quietly returns to the command prompt..
However when i do a select count(*) from the table it returns no rows.,.

can anyone help me with this..

A sample dialog is reproduced here ..

arttoday=# delete from exhibit_distributions ;
DELETE 0
arttoday=# select count(*) from exhibit_distributions ;
count
-------
0
(1 row)

arttoday=# \copy exhibit_distributions from stdin using delimiters '|' with null as ''

456|356|1001|'2001-01-23'|||5||/artetc/reproductions/grfx/small/04.jpg|/artetc/reproductions/grfx/large/04.jpg|94|74|||Dimensions|2|18|f|AT95004||ONLY_WORLD|INDIA|T|1111|'ARTETC'
\.
arttoday=# select count(*) from exhibit_distributions ;
count
-------
0
(1 row)
arttoday=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
(1 row)


ANy help will be appreciated..


Thanx
Anand

Re: \copy not importing in 702... (SOLVED)

From
Anand Raman
Date:
hi guys
I just realized that this is occuring because of a the absence of a
primary key in the other table.

Thus the copy command exited without any failure notice..

Thanx
Anand

On Wed, Jan 24, 2001 at 12:29:18AM +0530, Anand Raman wrote:
>hi guys
>
>I am having a strange problem with \copy ..
>When i am trying to copy from the a csv file \copy doesnt report any
>error and quietly returns to the command prompt..
>However when i do a select count(*) from the table it returns no rows.,.
>
>can anyone help me with this..
>
>A sample dialog is reproduced here ..
>
>arttoday=# delete from exhibit_distributions ;
>DELETE 0
>arttoday=# select count(*) from exhibit_distributions ;
>count
>-------
>0
>(1 row)
>
>arttoday=# \copy exhibit_distributions from stdin using delimiters '|' with null as ''

>456|356|1001|'2001-01-23'|||5||/artetc/reproductions/grfx/small/04.jpg|/artetc/reproductions/grfx/large/04.jpg|94|74|||Dimensions|2|18|f|AT95004||ONLY_WORLD|INDIA|T|1111|'ARTETC'
>\.
>arttoday=# select count(*) from exhibit_distributions ;
>count
>-------
>0
>(1 row)
>arttoday=# select version();
>version
>---------------------------------------------------------------------
>PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
>(1 row)
>
>
>ANy help will be appreciated..
>
>
>Thanx
>Anand