Thread: List of data bases

List of data bases

From
"Chr. Rossmanith"
Date:
Hi,

is there a way to list all data bases I've created so far?

Christina Rossmanith


Re: List of data bases

From
David Link
Date:
> is there a way to list all data bases I've created so far?
>

One way is to list out the subdirectories under $PGDATA/base

$ cd $PGDATA/base
$ ls

There should be a subdirectory per database if you haven't used
alternate PGDATA areas.

Re: List of data bases

From
"Duncan Adams (DNS)"
Date:
select * from pg_database

you can see a list of system tables with \dS

or look in

/usr/local/pgsql/data/base>

but then I'm still a novice

-----Original Message-----
From: Chr. Rossmanith [mailto:cr@neuro.ma.uni-heidelberg.de]
Sent: Tuesday, October 23, 2001 3:05 PM
To: pgsql-novice
Subject: [NOVICE] List of data bases


Hi,

is there a way to list all data bases I've created so far?

Christina Rossmanith


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: List of data bases

From
Jim Caley
Date:
In psql you can use "\l", like this:
    template1=# \l

Jim

"Chr. Rossmanith" wrote:
>
> Hi,
>
> is there a way to list all data bases I've created so far?
>
> Christina Rossmanith
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: List of data bases

From
"Brett W. McCoy"
Date:
On Tue, 23 Oct 2001, David Link wrote:

> One way is to list out the subdirectories under $PGDATA/base
>
> $ cd $PGDATA/base
> $ ls
>
> There should be a subdirectory per database if you haven't used
> alternate PGDATA areas.

A better way is to use psql -l on the command line or \l in an interactive
session.

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Now is the time for drinking; now the time to beat the earth with
unfettered foot.
        -- Quintus Horatius Flaccus (Horace)




Re: List of data bases

From
Francisco Solari
Date:
Another way is to enter psql  and execute \l

David Link wrote:

> > is there a way to list all data bases I've created so far?
> >
>
> One way is to list out the subdirectories under $PGDATA/base
>
> $ cd $PGDATA/base
> $ ls
>
> There should be a subdirectory per database if you haven't used
> alternate PGDATA areas.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

Attachment

Re: List of data bases

From
Vijay Deval
Date:
Hi

While connected to any database, if you type \l, it should give list of
all the databases that you created. \dt will list tables

All the documents cautions strongly against using postgres as root. So I
discounted the possiblity of # as root prompt.

Vijay

"Chr. Rossmanith" wrote:
>
> Hi,
>
> is there a way to list all data bases I've created so far?