pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
working with users
5+ messages / 5 participants
[nested] [flat]

* working with users
@ 2003-10-15 01:10  Sam Carleton <ehc@linux-info.net>
  0 siblings, 1 reply; 5+ messages in thread

From: Sam Carleton @ 2003-10-15 01:10 UTC (permalink / raw)
  To: pgsql-admin

Ok, I am a newbie, but I simply cannot find anything in the
documentation so I hope you all are kind to me...

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?  Because I was
the user postgres when I created the database, does that mean there
was a postgres user added during creation?  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?

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?

Sam



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* working with users
@ 2003-10-15 01:17  Sam Carleton <postgres@linux-info.net>
  0 siblings, 2 replies; 5+ messages in thread

From: Sam Carleton @ 2003-10-15 01:17 UTC (permalink / raw)
  To: pgsql-admin

Ok, I am a newbie, but I simply cannot find anything in the
documentation so I hope you all are kind to me...

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?  Because I was
the user postgres when I created the database, does that mean there
was a postgres user added during creation?  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?

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?

Sam



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: working with users
@ 2003-10-15 02:41  Bruno Wolff III <bruno@wolff.to>
  parent: Sam Carleton <postgres@linux-info.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Bruno Wolff III @ 2003-10-15 02:41 UTC (permalink / raw)
  To: pgsql-admin

On Tue, Oct 14, 2003 at 21:17:16 -0400,
  Sam Carleton <postgres@linux-info.net> wrote:
> 
> But how do I see what users exist for the database?  Because I was
One way is to use the \du command in psql.

> the user postgres when I created the database, does that mean there
> was a postgres user added during creation?  If not, what user am I

Yes.

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

By default the access mode is trust, so there is no password needed.

> 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?

Yes. They are described in the documentation under the headings
internals -> system catalogs.

You also might want to use \? to see the \ commands available in psql,
since there are a number of lookups using \ commands that might be
of interest to you.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: working with users
@ 2003-10-15 04:21  Michelle Murrain <tech@murrain.net>
  parent: Sam Carleton <postgres@linux-info.net>
  1 sibling, 0 replies; 5+ messages in thread

From: Michelle Murrain @ 2003-10-15 04:21 UTC (permalink / raw)
  To: Sam Carleton <postgres@linux-info.net>; +Cc: pgsql-admin

On Tue, 2003-10-14 at 21:17, Sam Carleton wrote:
> But how do I see what users exist for the database?  Because I was
> the user postgres when I created the database, does that mean there
> was a postgres user added during creation?  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?

There is a table called pg_shadow. It has the list of users and
passwords and what they can do. 

To see what you have now, use:

SELECT * from pg_shadow;
See: http://www.postgresql.org/docs/7.3/static/catalog-pg-shadow.html
and: http://www.postgresql.org/docs/7.3/interactive/user-manag.html
-- 
.Michelle
---------------------------
Michelle Murrain
mmurrain@dbdes.com
Database Designs Associates, Inc.
Boston   617.889.0929
Amherst  413.253.2874
Cell 	 413.222.6350
www.dbdes.com

AIM:pearlbear0 ICQ:129250575

"Our capacity to make peace with another person and with the world
depends very much on our capacity to make peace with ourselves." -- Thich Nhat Hanh




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: working with users
@ 2003-10-15 14:40  Oliver Elphick <olly@lfix.co.uk>
  parent: Sam Carleton <ehc@linux-info.net>
  0 siblings, 0 replies; 5+ messages in thread

From: Oliver Elphick @ 2003-10-15 14:40 UTC (permalink / raw)
  To: Sam Carleton <ehc@linux-info.net>; +Cc: 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.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




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-10-15 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-15 01:10 working with users Sam Carleton <ehc@linux-info.net>
2003-10-15 14:40 ` Oliver Elphick <olly@lfix.co.uk>
2003-10-15 01:17 working with users Sam Carleton <postgres@linux-info.net>
2003-10-15 02:41 ` Bruno Wolff III <bruno@wolff.to>
2003-10-15 04:21 ` Michelle Murrain <tech@murrain.net>

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