Stephen Frost wrote:

I agree that they should be consistant.  The GRANT ON ALL shares alot
more of the syntax with GRANT than DefaultACL though, which makes it a
more interesting question there.  I can understand not wanting to
duplicate the GRANT syntax.  I think my suggestion would be to add a
field to the structure passed around by GRANT which indicates if 'VIEW'
was requested or not in the command.  This could be used both for GRANT
ON ALL and to allow 'GRANT ON VIEW blah' to verify that the relation
being granted on is a view.


I arrived into this conclusion too, but it adds a lot of clutter in gram.y (setting that flag to false or something in many places, just to use in in one place).

Originally I thought adding ACL_OBJECT_VIEW wasn't such a bad idea. But after I looked more closely at the code, it it seems to me that having same object type for VIEW and TABLE seems like the only logical reason why GRANT uses separate object type enum at all (instead of using subset of ObjectType like other commands do). If we went this path of separating VIEW and TABLE in GRANT code it might be cleaner to remove GrantObjectType and use ObjectType, but I don't think we want to do that.


--
Regards
Petr Jelinek (PJMODOS)

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to