Re: 9.4 Proposal: Initdb creates a single table

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, Simon Riggs *EXTERN* <simon(at)2ndQuadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.4 Proposal: Initdb creates a single table
Date: 2014-04-23 07:39:23
Message-ID: 53576E2B.20201@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2014-04-23 07:46:49 Re: Minor improvements in alter_table.sgml
Previous Message Albe Laurenz 2014-04-23 07:20:54 Re: 9.4 Proposal: Initdb creates a single table