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-13 20:24:49
Message-ID: 20040413202449.9177.qmail@web40906.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank You Guy,

As you probably already read I solved it writing the whole html page into a
single table line.

I don't know if your solution would do it:

It happens inside a pl/pgsql function. The file names varies like t1.html,
t2.html, etc. where the t# is defined inside a FOR row IN select_query LOOP.
The written table have its rows deleted in all interactions after it is COPYed
TO.

Is it possible to redirect output from inside a pl/pgsql function?

Regards,
Clodoaldo

--- Guy Fraser <guy(at)incentre(dot)net> escreveu: > Ahh, I see.
>
> Like this from the command line :
>
> psql --no-align --tuples-only --field-separator , -c "select
> data,comment from test_table order by test_id ;" database >/tmp/file
>
> From psql prompt :
>
> \a\t\f,
> select data,comment from test_table order by test_id \g /tmp/file
> \a\t\f|
>
> Either way you should get a file {/tmp/file} contaning :
>
> 27,some kind of entry
> 32,another kind of entry
> 16,yet another entry
> ...
>

______________________________________________________________________

Yahoo! Messenger - Fale com seus amigos online. Instale agora!
http://br.download.yahoo.com/messenger/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-04-13 20:40:29 Re: insert rule not firing on insert with exists subselect
Previous Message Tom Lane 2004-04-13 20:24:01 Re: Join works in 7.3.6, fails in 7.4.2