Обсуждение: Allow user to create tables
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.
"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
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.
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.
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.
"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
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.