Re: Resetting priveleges on a table - Mailing list pgsql-general

From Tom Lane
Subject Re: Resetting priveleges on a table
Date
Msg-id 21997.1142363983@sss.pgh.pa.us
Whole thread Raw
In response to Re: Resetting priveleges on a table  (Bryan White <bryan@arcamax.com>)
Responses Re: Resetting priveleges on a table  (Bryan White <bryan@arcamax.com>)
List pgsql-general
Bryan White <bryan@arcamax.com> writes:
> ec=# \z bulkuploadcfg
>                              Access privileges for database "ec"
>   Schema |     Table     |                        Access privileges
> --------+---------------+------------------------------------------------------------------
>   public | bulkuploadcfg |
> {pconner=a*r*w*d*R*x*t*/pconner,=arwdRxt/pconner,=arwdRxt/bryan}
> (1 row)

Hm, this is 7.4.what exactly?  The above should be an illegal state
(assuming pconner is the table owner) because there is no grant option
to bryan allowing him to grant anything to public.

There was an old bug that would allow you to get into this state if
bryan was a superuser (the system would allow him to grant privileges
anyway), but according to the CVS logs we fixed that in 7.4RC1.  This
table wouldn't happen to be a holdover from a 7.4 beta version would it?

Another possibility is that you did an ALTER TABLE OWNER after assigning
some initial permissions.  7.4 had that command but it didn't do
anything about changing the ACL list to match.  I think you could have
gotten to the above state if pconner were the original table owner and
had done GRANT ALL TO PUBLIC, and then you altered table ownership to
bryan and he also did GRANT ALL TO PUBLIC.

Best solution might be to forcibly set the table's pg_class.relacl field
to null (resetting all the permissions to default) and then grant what
you want.

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Dynamic function execution?
Next
From: CSN
Date:
Subject: What's a good default encoding?