Re: COPY TO order

From: Clodoaldo Pinto Neto <clodoaldo_pinto(at)yahoo(dot)com(dot)br>
To: Guy Fraser <guy(at)incentre(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: COPY TO order
Date: 2004-04-12 19:17:01
Message-ID: 20040412191701.80181.qmail@web40903.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- Guy Fraser <guy(at)incentre(dot)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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message btober 2004-04-12 19:38:07 Re: db schema diff
Previous Message Igor Shevchenko 2004-04-12 18:35:25 db schema diff