From: Yogi Rizkiadi <gie05tech@yahoo.co.id>
To: pgsql-sql@postgresql.org
Subject: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Date: Sat, 29 Aug 2009 15:02:21 -0700 (PDT)
Message-ID: <797097.88507.qm@web76214.mail.sg1.yahoo.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: gie05tech@yahoo.co.id
Subject: Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
In-Reply-To: <797097.88507.qm@web76214.mail.sg1.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox