pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Sam Carleton <ehc@linux-info.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: working with users
Date: Wed, 15 Oct 2003 15:40:20 +0100
Message-ID: <1066228820.24290.275.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <20031015011052.GA8143@miltonstreet.com>
References: <20031015011052.GA8143@miltonstreet.com>

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.Elphick@lfix.co.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




view thread (5+ messages)

Message-ID: <1066228820.24290.275.camel@linda.lfix.co.uk>
Permalink:  ../1066228820.24290.275.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1066228820.24290.275.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: olly@lfix.co.uk, ehc@linux-info.net
  Subject: Re: working with users
  In-Reply-To: <1066228820.24290.275.camel@linda.lfix.co.uk>
  References: <20031015011052.GA8143@miltonstreet.com> <1066228820.24290.275.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox