Re: databases list to file

From: Jeff Ross <jross(at)wykids(dot)org>
To: Joao Ferreira gmail <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: databases list to file
Date: 2008-10-09 14:26:44
Message-ID: 48EE14BB.70609@wykids.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joao Ferreira gmail wrote:
> Hello all,
>
> I need to print to a file a simple list of all the databases on my
> postgresql.
>
> I need to do this from a shell script to be executed without human
> intervention
>
> I guess something like:
>
> su postgres -c 'psql ...whatever.... > /tmp/my_databases.txt'
>
> but I don't know exactly to what extent I can format the output of this
> in order to simplify the parser that will read that file.
>
> any suggestions ?
>
> thank you
>
> joao
>
>
>

psql -tc 'select datname from pg_database' template1

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-10-09 16:08:07 Re: PLSQL function calling another function
Previous Message cyw 2008-10-09 14:26:11 PLSQL function calling another function