Thread: basic postgres questions...

basic postgres questions...

From
"bruce"
Date:
hey.. .

can someone point me to the cmds that i'd use in order to see what databases
are created in my postgres app. i need to see what's here, and then i need
to know the cmd to then delete a given database, and the underlying tables.

in searching google, i'm seeing different cmds...

also, is there an irc channel for postgres!

thanks

-bruce



Re: basic postgres questions...

From
Ray Stell
Date:
On Wed, May 16, 2007 at 08:21:59AM -0700, bruce wrote:
> hey.. .
>
> can someone point me to the cmds that i'd use in order to see what databases
> are created in my postgres app. i need to see what's here, and then i need

template1=# select datname, oid from pg_database;
  datname  |  oid
-----------+-------
 postgres  | 10793
 template1 |     1
 template0 | 10792
 wiki      | 26158
(4 rows)


template1=# \l
       List of databases
   Name    |  Owner  | Encoding
-----------+---------+----------
 postgres  | pgadmin | UTF8
 template0 | pgadmin | UTF8
 template1 | pgadmin | UTF8
 wiki      | pgadmin | UTF8
(4 rows)


Re: basic postgres questions...

From
Shane Ambler
Date:
Ray Stell wrote:
> On Wed, May 16, 2007 at 08:21:59AM -0700, bruce wrote:
>> hey.. .
>>
>> can someone point me to the cmds that i'd use in order to see what databases
>> are created in my postgres app. i need to see what's here, and then i need
> > to know the cmd to then delete a given database, and the underlying
tables.
>
> template1=# select datname, oid from pg_database;
>   datname  |  oid
> -----------+-------
>  postgres  | 10793
>  template1 |     1
>  template0 | 10792
>  wiki      | 26158
> (4 rows)
>
>
> template1=# \l
>        List of databases
>    Name    |  Owner  | Encoding
> -----------+---------+----------
>  postgres  | pgadmin | UTF8
>  template0 | pgadmin | UTF8
>  template1 | pgadmin | UTF8
>  wiki      | pgadmin | UTF8
> (4 rows)
>
>

Then DROP DATABASE dbname; to delete it data and all.


--

Shane Ambler
pgSQL@Sheeky.Biz

Get Sheeky @ http://Sheeky.Biz

Re: basic postgres questions...

From
woodb@niwa.co.nz
Date:
> hey.. .
>
> can someone point me to the cmds that i'd use in order to see what
> databases
> are created in my postgres app. i need to see what's here, and then i need
> to know the cmd to then delete a given database, and the underlying
> tables.

from the OS command line, psql -l will list the available Postgres databases

For general info on this sort of admin task, see
http://www.postgresql.org/docs/8.2/static/managing-databases.html


> also, is there an irc channel for postgres!
See: http://www.postgresql.org/community/irc.html

there are several...


Cheers,

  Brent Wood