On 11/16/05, William Gerber <William.Gerber@erg.com> wrote:
> Hello. I am brand new to PostgreSQL and I need someone to point me in
> the right direction on how to write the results of a function to a text
> file. Is it possible to do this within the PostgreSQL PL/pgSQL
> language? I have done this before in Oracle using the UTL_FILE commands
> and I was hoping that PostgreSQL had similar functionality. I need to
> provide some data formatting in the text file that I produce so I don't
> think the pg_dump command would work for me (correct me if I am wrong
> though). Thanks in advance for any help that you can give.
>
psql DBname -f script > file
or
psql DBname -c "sql_command;"
psql --help to see options for formatting
>
> System Specs:
> PostgreSQL 8.1 on Linux
>
> --------------------------------------------------------------
> William Gerber
> ERG
> 5608 Parkcrest Drive, Suite 100
> Austin, TX 78731-4947
> ph: 512-407-1827
> fax: 512-419-0089
> e-mail: william.gerber@erg.com
> --------------------------------------------------------------
>
--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)