Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Yogi Rizkiadi <gie05tech(at)yahoo(dot)co(dot)id>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Date: 2009-08-30 06:51:56
Message-ID: 162867790908292351g14087219r970576b9006fb91b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

COPY in plpgsql are not allowed.

regards
Pavel Stehule

2009/8/30 Yogi Rizkiadi <gie05tech(at)yahoo(dot)co(dot)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!

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-08-30 15:53:54 Re: NEED HELP COPY TO DYNAMIC OUTPUT FILE
Previous Message Yogi Rizkiadi 2009-08-29 22:02:21 NEED HELP COPY TO DYNAMIC OUTPUT FILE