Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to create a new user in an existing postgresql database on an Ubuntu machine. I want to grant this user a read-only access to all the tables.

How do I do it? Do I need to create a new user on Ubuntu, too?

Thanks,

Udi

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

No need to create a new user in the operating system. Just issue:

CREATE USER newusername

in psql (or pgadmin, or whatever tool you prefer) and you will have a new user. What access this user has depends on what your tables are set up for. But default, it will not have permissions on any tables, so you will have to GRANT this. If you have already GRANTed permissions to the public group, the user will have thos permissions from the start.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.