Skip site navigation (1) Skip section navigation (2)

Re: database

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: database
Date: 2005-11-27 06:28:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
am  21.11.2005, um 13:55:01 -0200 mailte Jovito BalsamXo dos Santos folgendes:
> Hello, group's users,
> I would like to know how i can select all the database from the server. 
> It's like below:

1. you can use 'psql -l' to list all databases
2. within psql, you can use '\l' to list all databases
3. You can use SQL:

   SELECT d.datname as "Name",
          r.rolname as "Owner",
          pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding"
   FROM pg_catalog.pg_database d
     LEFT JOIN pg_catalog.pg_roles r ON d.datdba = r.oid
   ORDER BY 1;

   Hint: this is the result if you start psql with -E and the run \l.

HTH, Andreas
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C
 ===    Schollglas Unternehmensgruppe    === 

In response to

  • database at 2005-11-21 15:55:01 from Jovito BalsamXo dos Santos

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2005-11-27 07:03:19
Subject: Re: MSSQL migration questions
Previous:From: Thomas HaroldDate: 2005-11-27 05:33:34
Subject: MSSQL migration questions

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group