Thread: table permissions

table permissions

From
Oleg Lebedev
Date:
Hi everybody,
I can't seem to figure this one out.
I have a superuser root and a regular user oleg. I am trying to insert a
new row in table Set, which references table Activity, being logged in
as root. I get an error saying:
activity: Permission denied.
This is very weird because root has all the permissions on every table
in the database. Even more strange is that as soon as I grant DELETE
privilege to user oleg, the problem disappears and I can add a row to
the Set table.
Does anybody know how to solve this problem?
Should I upgrade my PostgreSQL version? I am currently using v 7.1.2
thanks,

Oleg



Re: table permissions

From
Tom Lane
Date:
Oleg Lebedev <olebedev@waterford.org> writes:
> I have a superuser root and a regular user oleg. I am trying to insert a
> new row in table Set, which references table Activity, being logged in
> as root. I get an error saying:
> activity: Permission denied.
> This is very weird because root has all the permissions on every table
> in the database. Even more strange is that as soon as I grant DELETE
> privilege to user oleg, the problem disappears and I can add a row to
> the Set table.

Evidently the update is being done under privileges of user oleg.
Are you using a view, rule, function, trigger, etc somewhere in there?
I doubt this would happen with a straightforward INSERT typed at the
command line, but if the insert command is in a rule or function owned
by oleg, the game is different ...
        regards, tom lane


Re: table permissions

From
Oleg Lebedev
Date:
Tom,
you were right, some of the tables were owned by oleg. I changed it and now it
works fine.
So, in order for the table to be updated successfully, it's owner and updating
user must have permissions to do that, right?
thanks a lot,

Oleg

Tom Lane wrote:

> Oleg Lebedev <olebedev@waterford.org> writes:
> > I have a superuser root and a regular user oleg. I am trying to insert a
> > new row in table Set, which references table Activity, being logged in
> > as root. I get an error saying:
> > activity: Permission denied.
> > This is very weird because root has all the permissions on every table
> > in the database. Even more strange is that as soon as I grant DELETE
> > privilege to user oleg, the problem disappears and I can add a row to
> > the Set table.
>
> Evidently the update is being done under privileges of user oleg.
> Are you using a view, rule, function, trigger, etc somewhere in there?
> I doubt this would happen with a straightforward INSERT typed at the
> command line, but if the insert command is in a rule or function owned
> by oleg, the game is different ...
>
>                         regards, tom lane



table permissions II

From
Haller Christoph
Date:
I had similar problems, especially when granting DELETE permissions 
insert commands worked as intended. 
And I did not mess with any config files. 
Regards, Christoph 

> Hi everybody,
> I can't seem to figure this one out.
> I have a superuser root and a regular user oleg. I am trying to insert a
> new row in table Set, which references table Activity, being logged in
> as root. I get an error saying:
> activity: Permission denied.
> This is very weird because root has all the permissions on every table
> in the database. Even more strange is that as soon as I grant DELETE
> privilege to user oleg, the problem disappears and I can add a row to
> the Set table.
> Does anybody know how to solve this problem?
> Should I upgrade my PostgreSQL version? I am currently using v 7.1.2