NEED HELP COPY TO DYNAMIC OUTPUT FILE

From: Yogi Rizkiadi <gie05tech(at)yahoo(dot)co(dot)id>
To: pgsql-sql(at)postgresql(dot)org
Subject: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Date: 2009-08-29 22:02:21
Message-ID: 797097.88507.qm@web76214.mail.sg1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi admin, i'm gie from indonesia

i wanna ask you how to make a dynamic output file from command COPY TO ?

i have tried this :

BEGIN
i:=0;
j:=10;
WHILE i < j LOOP
COPY (SELECT * FROM country) TO '/usr/proj/' || i || '.txt'; // need attention here
END LOOP;
RETURN;
END

but it seems getting wrong, so what the right syntax's ?

Sorry for my bad english and thanks in advance

Coba Yahoo! Messenger 9.0 baru. Lengkap dengan segala yang Anda sukai tentang Messenger! http://id.messenger.yahoo.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2009-08-30 06:51:56 Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Previous Message Rob Sargent 2009-08-28 16:19:22 Re: recursively isolate pedigrees, based only on person_id, mother_id and father_id