Re: Mysterious empty database name?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Mysterious empty database name?
Дата
Msg-id 674.1274827200@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Mysterious empty database name?  (Azlin Rahim <azlin.rahim@gmail.com>)
Ответы Re: Mysterious empty database name?
Список pgsql-general
Azlin Rahim <azlin.rahim@gmail.com> writes:
> In our database list, there is one 'mysterious' database with a blank name.
> We don't know how it got there.

Your mail client has done you no favors as far as preserving the
formatting of the SELECT output, but it looks to me like the name of the
weird database is probably not blank but rather contains some control
characters (perhaps a carriage return?).  Depending on how old your psql
is, that could result in wacky formatting, which is what it looks like
you've got here.  Another theory is that it's an encoding problem:
non-ASCII database names are troublesome if you don't use the same
encoding in each database.

I'd suggest trying the SELECT under some other output format, perhaps
\pset format unaligned, to see if it gets any more readable.

Depending on what the name really is, you might be able to type it as a
double-quoted identifier, in which case ALTER DATABASE RENAME would
work to fix it.  If all else fails, you could try getting the OID
of the database and then
    UPDATE pg_database SET datname = 'something_sane' WHERE oid = nnn;
as superuser should fix it.  (If it's pre-8.1 PG, you might need another
ALTER DATABASE RENAME to be sure subsidiary files are updated.)

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Azlin Rahim
Дата:
Сообщение: Mysterious empty database name?
Следующее
От: alvherre
Дата:
Сообщение: Re: Mysterious empty database name?