Обсуждение: Problems with PostgreSQL 7.1.2

Поиск
Список
Период
Сортировка

Problems with PostgreSQL 7.1.2

От
Fabio Sobral
Дата:
Dear Sirs,

   In old versions of PostgreSQL, we could see the database names in the
pgsql/data/base directory, perhaps in this version, we can´t see the
database names, we see numbers that represents the databases. I would
like to know how can I do to appear the databases names instead of
numbers.

Regards,

Fabio Sobral.


Re: Problems with PostgreSQL 7.1.2

От
"Oliver Elphick"
Дата:
Fabio Sobral wrote:
  >Dear Sirs,
  >
  >   In old versions of PostgreSQL, we could see the database names in the
  >pgsql/data/base directory, perhaps in this version, we can´t see the
  >database names, we see numbers that represents the databases. I would
  >like to know how can I do to appear the databases names instead of
  >numbers.

To find the table name to file mapping in a database:

  SELECT relname, relfilenode
    FROM pg_class
    ORDER BY relname;

relfilenode seems to be the same as the table's oid, but there must be
circumstances where that is not the case.


To find the mapping of databases to the numbers under ${PGDATA}/base:

  SELECT datname, oid
    FROM pg_database
    ORDER BY datname;

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Love is patient, love is kind. It does not envy, it
      does not boast, it is not proud. It is not rude, it is
      not self seeking, it is not easily angered, it keeps
      no record of wrongs. Love does not delight in evil but
      rejoices with the truth. It always protects, always
      trusts, always hopes, always perseveres."
                                I Corinthians 13:4-7



Re: Problems with PostgreSQL 7.1.2

От
Grant
Дата:
>    In old versions of PostgreSQL, we could see the database names in the
> pgsql/data/base directory, perhaps in this version, we can�t see the
> database names, we see numbers that represents the databases. I would
> like to know how can I do to appear the databases names instead of
> numbers.

You should not be touching any files used by postgresql, except
pg_hba.conf. If you want a list of all available databases perform this
command from the command line:

psql -h localhost -U postgres template1 -q -c "\l"