Thread: working with users
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
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.
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