Permission denied while insert

Started by Jose Manuel Lorenzo Lopezabout 25 years ago5 messagesgeneral
Jump to latest
#1Jose Manuel Lorenzo Lopez
jose-manuel.lorenzo-lopez@conti.de

Hi folks,

I noticed a strange behavior of my DB. Let me explain:

I created a table bdf_users as admin user 'postgres' and granted insert
access for this table to public.

Now I want to insert a line as user 'jose' (That's me!) and got the
following message:

ERROR: bdf_users: Permission denied.

Am I doing anything dumb? I am using postgresql 7.0.3 on SuSE Linux 7.1
(although I compiled by myself postgresql)

Best Regards

Jos� Manuel Lorenzo L�pez

--
**********************************************************************
** Jos� Manuel Lorenzo L�pez **
** **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH **
** Dept. SAP Basis R/3 VBue **
** **
** e-mail to: jose-manuel.lorenzo-lopez@conti.de **
**********************************************************************

#2Tulio Oliveira
tulio@marilia.com
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: Permission denied while insert

Jose Manuel Lorenzo Lopez wrote:

Hi folks,

I noticed a strange behavior of my DB. Let me explain:

I created a table bdf_users as admin user 'postgres' and granted insert
access for this table to public.

Now I want to insert a line as user 'jose' (That's me!) and got the
following message:

ERROR: bdf_users: Permission denied.

Am I doing anything dumb? I am using postgresql 7.0.3 on SuSE Linux 7.1
(although I compiled by myself postgresql)

Best Regards

Jos� Manuel Lorenzo L�pez

are you inserting directly over the table, or in a view of this table ?

I had problems inserting data in a View with no records ...

regards

Tulio

#3Jose Manuel Lorenzo Lopez
jose-manuel.lorenzo-lopez@conti.de
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: Permission denied while insert

Tulio Oliveira schrieb:

are you inserting directly over the table, or in a view of this table ?

I had problems inserting data in a View with no records ...

Hello Tulio,

nope, I am inserting directly into the table! The table is also filled
with some data.

Best Regards / Un saludo / Mit freundlichen Gr��en / Cordiali Saluti

Jos� Manuel Lorenzo L�pez

--
**********************************************************************
** Jos� Manuel Lorenzo L�pez **
** **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH **
** Dept. SAP Basis R/3 VBue **
** **
** e-mail to: jose-manuel.lorenzo-lopez@conti.de **
**********************************************************************

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: Permission denied while insert

Jose Manuel Lorenzo Lopez <jose-manuel.lorenzo-lopez@conti.de> writes:

I created a table bdf_users as admin user 'postgres' and granted insert
access for this table to public.
Now I want to insert a line as user 'jose' (That's me!) and got the
following message:
ERROR: bdf_users: Permission denied.

Hmm ... what does "\z bdf_users" (in psql) show?

Am I doing anything dumb? I am using postgresql 7.0.3 on SuSE Linux 7.1
(although I compiled by myself postgresql)

There is a bug in 7.0.* that causes the default owner's permissions to
be forgotten when you do an explicit GRANT; you then have to re-grant
ALL to yourself to reactivate the permissions you have by default. But
that doesn't seem to apply to this case, since jose is not the owner of
bdf_users if I understood you correctly.

regards, tom lane

#5Jose Manuel Lorenzo Lopez
jose-manuel.lorenzo-lopez@conti.de
In reply to: Jose Manuel Lorenzo Lopez (#1)
Re: Permission denied while insert

Hello Tom,

Tom Lane wrote:

Jose Manuel Lorenzo Lopez <jose-manuel.lorenzo-lopez@conti.de> writes:

I created a table bdf_users as admin user 'postgres' and granted insert
access for this table to public.
Now I want to insert a line as user 'jose' (That's me!) and got the
following message:
ERROR: bdf_users: Permission denied.

Hmm ... what does "\z bdf_users" (in psql) show?

\z bdf_users

Access permissions for database "jose"
Relation | Access permissions
-------------------------------
bdf_users | {"=ar"}

This seems to be okay!

There is a bug in 7.0.* that causes the default owner's permissions to
be forgotten when you do an explicit GRANT; you then have to re-grant
ALL to yourself to reactivate the permissions you have by default. But
that doesn't seem to apply to this case, since jose is not the owner of
bdf_users if I understood you correctly.

Yes, the table was created by the admin user 'postgres' and this user
is able to insert, update, ... The only thing that user 'jose' is able
to is doing select on the table bdf_users. Thank you otherwise for the
advice
about the bug in 7.0.* :)

Best regards,

Jos� Manuel Lorenzo L�pez

--
**********************************************************************
** Jos� Manuel Lorenzo L�pez **
** **
** ICA Informationssysteme Consulting & Anwendungsgesellschaft mbH **
** Dept. SAP Basis R/3 VBue **
** **
** e-mail to: jose-manuel.lorenzo-lopez@conti.de **
**********************************************************************