Allow user to create tables

Started by Tille, Andreasalmost 24 years ago7 messagesgeneral
Jump to latest
#1Tille, Andreas
TilleA@rki.de

Hello,

I just created a database and granted all rights to the tables I created to
an additional user. I observed that this user does not have the right to
create additional tables. Which right do I have to grant to this user
to give him full access (including creating new objects like tables,
sequences, etc. ) to this additional user?

I'm using PostgreSQL 7.2.1.

Kind regards

Andreas.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tille, Andreas (#1)
Re: Allow user to create tables

"Tille, Andreas" <TilleA@rki.de> writes:

I just created a database and granted all rights to the tables I created to
an additional user. I observed that this user does not have the right to
create additional tables.

I think you have that backwards ;-). In PG you *cannot prevent* a user
from being able to create tables.

7.3 will have permissions that control this, but no extant release does.

regards, tom lane

#3Bruno Wolff III
bruno@wolff.to
In reply to: Tille, Andreas (#1)
Re: Allow user to create tables

On Tue, May 07, 2002 at 07:55:34AM +0200,
"Tille, Andreas" <TilleA@rki.de> wrote:

Hello,

I just created a database and granted all rights to the tables I created to
an additional user. I observed that this user does not have the right to
create additional tables. Which right do I have to grant to this user
to give him full access (including creating new objects like tables,
sequences, etc. ) to this additional user?

If the person has access to the database then they can create objects.

#4Tille, Andreas
TilleA@rki.de
In reply to: Tom Lane (#2)
PgAdmin2 trouble (Was: Allow user to create tables)

On Tue, 7 May 2002, Tom Lane wrote:

"Tille, Andreas" <TilleA@rki.de> writes:

I just created a database and granted all rights to the tables I created to
an additional user. I observed that this user does not have the right to
create additional tables.

I think you have that backwards ;-). In PG you *cannot prevent* a user
from being able to create tables.

7.3 will have permissions that control this, but no extant release does.

Hmm, great :).

Perhaps it is a bug inside PgAdmin2. The user I was talking about is
using this frontend. He gets errors if he tries to create or drop
tables.

But you are right: If I 'su thisuser' and do it in psql I'm able to
do all things he failed to do in PgAdmin2.

Kind regards

Andreas.

#5Tille, Andreas
TilleA@rki.de
In reply to: Tom Lane (#2)
Re: Allow user to create tables

On Tue, 7 May 2002, Tom Lane wrote:

"Tille, Andreas" <TilleA@rki.de> writes:

I just created a database and granted all rights to the tables I created to
an additional user. I observed that this user does not have the right to
create additional tables.

I think you have that backwards ;-). In PG you *cannot prevent* a user
from being able to create tables.

7.3 will have permissions that control this, but no extant release does.

Sorry, forget about my previous mail which I claimed that PgAdmin2
was causing trouble.

~> whoami
databaseowner
~> psql test
...
test=# create table test (i int, t varchar(17) );
CREATE
test=# grant all on test to testuser ;
GRANT
test=# \q

~> su testuser
...
~> psql test
test=> drop table test;
ERROR: you do not own table "test"

Did I miss something?

Kind regards

Andreas.

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tille, Andreas (#5)
Re: Allow user to create tables

"Tille, Andreas" <TilleA@rki.de> writes:

test=> drop table test;
ERROR: you do not own table "test"

Did I miss something?

No. What is not clear about that error message? Only the owner can
drop a table. It's not considered a grantable right.

regards, tom lane

#7scott.marlowe
scott.marlowe@ihs.com
In reply to: Tom Lane (#6)
Re: Allow user to create tables

On Wed, 8 May 2002, Tom Lane wrote:

"Tille, Andreas" <TilleA@rki.de> writes:

test=> drop table test;
ERROR: you do not own table "test"

Did I miss something?

No. What is not clear about that error message? Only the owner can
drop a table. It's not considered a grantable right.

But it is something you can change. As the table owner or superuser,
Andreas, you can issue the following command:

alter table ttt owner to somebody;

There ya go.