Re: Post Install / Secure PostgreSQL

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Post Install / Secure PostgreSQL
Date: 2010-09-15 18:18:59
Message-ID: 4C910E13.6090104@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/15/10 11:10 AM, Carlos Mennens wrote:
> On Wed, Sep 15, 2010 at 1:43 PM, John R Pierce<pierce(at)hogranch(dot)com> wrote:
>
>> the 'postgres' database on your system is empty. this is quite typical, as
>> that database is simply a convenience for the postgres user to have
>> something to log into while doing his administrative duties.
> OK this makes sense and I couldn't find in the docs or any reading
> that by default the 'postgres' database is empty and there for just a
> space for the 'postgres' user to login to. That explains a lot but
> when I run:
>
> postgres=# SELECT * FROM pg_user;
> usename | usesysid | usecreatedb | usesuper | usecatupd | passwd |
> valuntil | useconfig
> ----------+----------+-------------+----------+-----------+----------+----------+-----------
> postgres | 10 | t | t | t | ******** |
> |
> webmail | 16384 | f | f | f | ******** |
> |
> carlos | 16385 | t | t | t | ******** |
> |
> (3 rows)
>
> Doesn't that show I'm connected to the 'postgres' database and there
> is a table called 'pg_user' which holds all my PostgreSQL user info?
> That doesn't make sense to me if the database is empty unless I am
> missing something here. The only way I knew 'pg_user' was available
> was because I ran the command '\dS'.

there is an extensive pg_catalog schema containing the system tables
which are shared by all databases in the cluster. pg_catalog.pg_user
is the same view in all databases.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-09-15 18:23:50 Re: Post Install / Secure PostgreSQL
Previous Message Alan Hodgson 2010-09-15 18:15:32 Re: Post Install / Secure PostgreSQL