Thread: How do I create a Postgres user.

How do I create a Postgres user.

From
"Suddn"
Date:
Now that I have postgres working I would like to use it.  However, it won't
let me start a session unless I log in using the postgres account.

How do I setup postgres accounts for other users?

Thanks.



Re: How do I create a Postgres user.

From
Tyson Oswald
Date:
Suddn
    Log into your box as postres and launch psql -d [dbname] by default eh
dbname should be template1.  Once logged in type the following

create user [username] with password [password];

like
create user root with password tree;

you will Laos have to grant that user rights to the database.

grant all on [tablename] to [object];

like
grant all on people to root; // people is obviously a table; unfortunately I
don't know how to give them complete access to the database perhaps a option on
the create user function.

I believe the user must be an active account on the box as postgres like
informix uses the current user logging in as the database user.  there may also
be a switch for psql, I don't know.

Hope this helps

Tyson Oswald

Suddn wrote:

> Now that I have postgres working I would like to use it.  However, it won't
> let me start a session unless I log in using the postgres account.
>
> How do I setup postgres accounts for other users?
>
> Thanks.