Thread: How: single db, multiple users

How: single db, multiple users

From
P G
Date:
Greetings,

I am new to PostgreSQL and come from an DB2
background.  I currently have v8.0.3 up and running.
So far, it looks great!

One area I am confused about is how to set up
databases and users.  I can currently create
databases, but I am having difficulty in assigning
mutiple users to those databases.  For example, I have
set up one database for a large project.  There are
several users that need to have access to that
database: create tables, insert, delete, select,
update, etc.  The documentation talks about a single
user-database associations but is not clear on how to
have multiple users on a single database.

Are there any best practices that I could follow in
settings these up for various projects and databases?
Or if this is a simple thing to do, any pointers on
how to do it?










__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com


Re: How: single db, multiple users

From
Eric E
Date:
Postgres' users are not specific to a database, they are shared across
all databases on a particular server.

At the database level, you can assign creation and other permissions to
users, but (AFAIK) you cannot deny users to a database. However, you can
effectively control users' access to a particular database by granting
or denying them access to a schema within that database.

Hope that helps,

Eric

P G wrote:

>Greetings,
>
>I am new to PostgreSQL and come from an DB2
>background.  I currently have v8.0.3 up and running.
>So far, it looks great!
>
>One area I am confused about is how to set up
>databases and users.  I can currently create
>databases, but I am having difficulty in assigning
>mutiple users to those databases.  For example, I have
>set up one database for a large project.  There are
>several users that need to have access to that
>database: create tables, insert, delete, select,
>update, etc.  The documentation talks about a single
>user-database associations but is not clear on how to
>have multiple users on a single database.
>
>Are there any best practices that I could follow in
>settings these up for various projects and databases?
>Or if this is a simple thing to do, any pointers on
>how to do it?
>
>
>
>
>
>
>
>
>
>
>__________________________________________
>Yahoo! DSL – Something to write home about.
>Just $16.99/mo. or less.
>dsl.yahoo.com
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Have you searched our list archives?
>
>               http://archives.postgresql.org
>
>
>


Re: How: single db, multiple users

From
P G
Date:
--- Eric E <whalesuit@gmail.com> wrote:
> At the database level, you can assign creation and
> other permissions to
> users, but (AFAIK) you cannot deny users to a
> database. However, you can
> effectively control users' access to a particular
> database by granting
> or denying them access to a schema within that
> database.

Eric,

Thanks for the carification.  It is quite helpful for
me early in my introduction to PostgreSQL.

So that I hear you correctly, it is OK then for only
one user to be the owner of a database.  Then I will
give other users privileges on a one by one basis.
And I can do this for a particular schema in a
database or all schemas in it, without enumerating all
the tables in those schemas?  Am I correct?

What kind of privileges do I need to give other users
so that they can create tables, delete them, update
them, etc. in that database?   Can I use "ALL"
priveleges here?






__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs