Re: 9.4 Proposal: Initdb creates a single table

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: 9.4 Proposal: Initdb creates a single table
Дата
Msg-id 53576E2B.20201@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: 9.4 Proposal: Initdb creates a single table  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Ответы Re: 9.4 Proposal: Initdb creates a single table  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-hackers
On 04/23/2014 03:20 PM, Albe Laurenz wrote:
> Good that you mention that!  I have wondered what to do with it.
> When I first connected to PostgreSQL, I created a sample table, but the
> senior developer from the other office told me that this is the "postgres"
> database and that I shouldn't create any objects there.
> 
> What is it good for?  Can I delete it?

A key difference between the "postgres" DB and a default table is that
the "postgres" DB is very convenient with PostgreSQL's default of
connecting to a DB of the same name as the user.

We don't have a corresponding
   INSERT VALUES (42);
   SELECT fred;

where there is some invisible implicit table name.

Personally I wish Pg was able to start w/o "connecting" to any specific
DB, but that's just not how the architecture works, and with that
limitation the "postgres" DB seemed like a good compromise. (That said,
it's really weird that the username of the superuser defaults to the
current unix user when initdb'ing, but the db created by default is
still always "postgres").

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Albe Laurenz
Дата:
Сообщение: Re: 9.4 Proposal: Initdb creates a single table
Следующее
От: Etsuro Fujita
Дата:
Сообщение: Re: Minor improvements in alter_table.sgml