Greetings,
I'm trying to create a user without create privileges and I don't seem
to be able to do it. I could be clueless, but after my revoke
statements, the new user still seems to be able to create dbs, and then
have full privileges on them. Am I missing something?
Below is the output of my terminal window where I create a new user
(which doesn't have select privileges), but even after revoke can still
create new tables.
Any info would be much appreciated, I need to give someone select
access to a view and I can't do it if they can still create dbs.
Cheers,
Chris
chris@torvalds chris]$ createuser newuser
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
[chris@torvalds chris]$ psql a -U newuser
Welcome to psql 7.4RC2, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
a=> select * from ind;
ERROR: permission denied for relation ind
a=> \q
[chris@torvalds chris]$ psql
Welcome to psql 7.4RC2, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
chris=# revoke all on database a from newuser;
REVOKE
chris=# revoke create on database a from newuser;
REVOKE
chris=# \q
[chris@torvalds chris]$ psql a -U newuser
Welcome to psql 7.4RC2, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
a=> create table foo(bar integer);
CREATE TABLE
a=> insert into foo values(1);
INSERT 6273211 1
a=> select * from foo;
bar
-----
1
(1 row)