Re: Post Install / Secure PostgreSQL

From: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Post Install / Secure PostgreSQL
Date: 2010-09-14 16:50:30
Message-ID: AANLkTi=Z7VXV1z9ce5baKs8h_uPwnA7FyzFGJa-dFr4M@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 13, 2010 at 9:58 PM, Craig Ringer
<craig(at)postnewspapers(dot)com(dot)au> wrote:
> craig$ sudo -u postgres psql
> postgres=> CREATE USER craig WITH PASSWORD 'somepassword'
>           CREATEDB CREATEROLE;
> postgres=> CREATE DATABASE craig WITH OWNER craig;
> postgres=> \q

So I set a Linux shell password on my newly auto created 'postgres'
system user which is what I use to login to the database as
'superuser'. Now I know my password for 'postgres' in the Linux shell
but I still don't understand what the database password is for
'postgres'. In MySQL there is a root shell user (obviously) and then
rather than 'postgres' for the database super user, there is a 'root'
database user and I can set that password individually from the
matching shell account.

So maybe I am still lost but it appears that the database user
'postgres' has a password unique to PostgreSQL, right?

postgres=# SELECT * from pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd |
valuntil | useconfig
----------+----------+-------------+----------+-----------+----------+----------+-----------
postgres | 10 | t | t | t | ******** |
|
carlos | 16384 | t | t | t | ******** |
|

Obviously there appears to be a specific password for both accounts
which I think are completely seperate from the Linux shell passwords,
right?

Secondly I am unable to find any information in the docs that show me
how to set just the user password for 'carlos'. In MySQL I would use:

SET PASSWORD FOR 'carlos'@'localhost' = PASSWORD('newpass');

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Satoshi Nagayasu 2010-09-14 16:55:13 Re: Monitoring Object access
Previous Message Luís de Sousa 2010-09-14 15:34:41 Re: Replacing characters in a string