From: Pavel Stehule <pavel.stehule@gmail.com>
To: Yogi Rizkiadi <gie05tech@yahoo.co.id>
Cc: pgsql-sql@postgresql.org
Subject: Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Date: Sun, 30 Aug 2009 08:51:56 +0200
Message-ID: <162867790908292351g14087219r970576b9006fb91b@mail.gmail.com> (raw)
In-Reply-To: <797097.88507.qm@web76214.mail.sg1.yahoo.com>
References: <797097.88507.qm@web76214.mail.sg1.yahoo.com>
Hello
COPY in plpgsql are not allowed.
regards
Pavel Stehule
2009/8/30 Yogi Rizkiadi <gie05tech@yahoo.co.id>:
> 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
>
>
> ________________________________
> Dapatkan alamat Email baru Anda!
> Dapatkan nama yang selalu Anda inginkan sebelum diambil orang lain!
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: pavel.stehule@gmail.com, gie05tech@yahoo.co.id
Subject: Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
In-Reply-To: <162867790908292351g14087219r970576b9006fb91b@mail.gmail.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