Re: working with users

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Sam Carleton <ehc(at)linux-info(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: working with users
Date: 2003-10-15 14:40:20
Message-ID: 1066228820.24290.275.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2003-10-15 at 02:10, Sam Carleton wrote:
> Ok, I am a newbie, but I simply cannot find anything in the
> documentation so I hope you all are kind to me...

Read through the Administrator's Manual - client authentication section.

> I have installed Postgres 7.3.4 (will reinstall once I get OpenSLL
> compiled into it). I created the postgres user, and the first
> database. As the postgress user, I am able to run psql and access
> the database that I created. I have been able to run the create
> user command.
>
> But how do I see what users exist for the database?

SELECT * FROM pg_user;

Users exist for the whole database cluster, not just one database.
However you can use client authentication (see below) to limit access to
particular databases.

> Because I was
> the user postgres when I created the database, does that mean there
> was a postgres user added during creation?

Yes (unless you specified differently on initdb's command line.)

> If not, what user am I
> when I run psql as postgres? If I am postgres, what is the password
> to the database and how do I rest it?

User authentication is controlled by the file $PGDATA/pg_hba.conf

By default, access is allowed without any check or password to anyone
connecting through the Unix socket; users are trusted to tell the truth
about who they are.

You can set a password with ALTER USER but it won't be used until you
change the authentication policy.

> Now I am not a DBA, but I have been around enough databases to know
> that most of them have their own system tables. Does postgres have
> system tables? If so, where do I find a list of them and their
> usage?

They are in the documentation.

In psql, the command \dS will list them.
--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"If ye love me, keep my commandments." John 14:15

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2003-10-15 15:26:52 Re: Lock!
Previous Message Kris Kiger 2003-10-15 14:14:09 ERserver patch question