Hi,
I found that has_table_privilege returns an error when a table is specified
by schema-qualified name and the user doen't have privilege for its schema.
postgres=> select has_table_privilege('myschema.tbl','select');
ERROR: permission denied for schema myschema
I think that this function should return false because the user doesn't have
the privilege on this table eventually. It is more useful for users because
it is not needed to parse the schema-qualified table name and check the
privilege on the schema in advance.
Attached is a patch to modify the function like that. This is WIP patch, so
only has_table_previlege is modified and other familiy functions are left as
they are. Also, there is no additional test yet.
One consern on this patch is that modifying the function can break the
back-compatibility, so it might be better to add a new parameter to
control the behavior of the function.
Any comments would be appriciated.
Regards,
--
Yugo Nagata <nagata@sraoss.co.jp>