Re: COPY TO order - Mailing list pgsql-general

From Clodoaldo Pinto Neto
Subject Re: COPY TO order
Date
Msg-id 20040413202449.9177.qmail@web40906.mail.yahoo.com
Whole thread Raw
In response to Re: COPY TO order  (Guy Fraser <guy@incentre.net>)
List 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@incentre.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/

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Join works in 7.3.6, fails in 7.4.2
Next
From: Tom Lane
Date:
Subject: Re: insert rule not firing on insert with exists subselect