Re: Select results output to file? - Mailing list pgsql-novice

From Joe Conway
Subject Re: Select results output to file?
Date
Msg-id 3E700D28.9070309@joeconway.com
Whole thread Raw
In response to Select results output to file?  (Dennis King <d_r_king@yahoo.com>)
List pgsql-novice
Dennis King wrote:
> I want to output to a file, but haven't found anything but the SQL
> copy statement. I want to output the results of a select statement,
> though. Ideally I'd be doing this from inside a pl/pgsql function.

You can't do that from a plpgsql function short of writing your own C
function and calling it from there. You probably can write to a output
file from plperlu or pltclu; see:
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/plperl-trusted.html
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/pltcl.html

You can also use psql either in batch mode or interactively; see:
http://www.us.postgresql.org/users-lounge/docs/7.3/postgres/app-psql.html

Joe





pgsql-novice by date:

Previous
From: Dennis King
Date:
Subject: Select results output to file?
Next
From: "jenner viloria"
Date:
Subject: client