Search Postgresql Archives

Re: COPY TO order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 --- Guy Fraser <guy@incentre.net>

> If you have a 'serial' or 'bigserial' field like this :
> 
> create table test_table (
> test_id bigserial,
> data integer,
> comment text
> );
> 
> and you use :
> 
> copy test_table (data,comment) 
> from '/wherever/the/file/is' 
> using delimiters ',';
> 
> 
> to insert data like this :
> 
> 27,some kind of entry
> 32,another kind of entry
> 16,yet another entry
> ...
> 
> Assuming this is the first set of data entered the table will get populated
> with :
> 
>  1 | 27 | some kind of entry    
>  2 | 32 | another kind of entry 
>  3 | 16 | yet another entry     
> ...
> 
> I have used this in the past and it works well.

The problem I have is with COPY TO and not COPY FROM as I need to write a file.

Regards,
Clodoaldo

______________________________________________________________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora! 
http://br.download.yahoo.com/messenger/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux