Обсуждение: GRANT USAGE ON SCHEMA

Поиск
Список
Период
Сортировка

GRANT USAGE ON SCHEMA

От
Edwin UY
Дата:
Hi,

Just playing around here trying and 'confused' what the GRANT USAGE ON SCHEMA is supposed to be for?
I thought it was supposed to all 'full' access of one schema to the other

I have created 2 schema a, b and I did

grant usage on schema a to b
grant usage on schema b to a

I tried to select tables from one to the other and it is giving permission denied until I have to do the grant below.

grant all on all tables in schema a to b ;
grant all on all tables in schema b to a ;

Is this expected behavior? Or does the GRANT USAGE only allows switching between schema?

Regards,
Edd

Re: GRANT USAGE ON SCHEMA

От
"David G. Johnston"
Дата:
On Sat, Jun 14, 2025 at 3:09 PM Edwin UY <edwin.uy@gmail.com> wrote:
I thought it was supposed to all 'full' access of one schema to the other
 
Where did you get the idea that objects (aside from roles) ever get privileges on other objects?  Or did you also create roles "a" and "b" and are just using the wrong terminology here?

There is also no such thing as permissions on one type of object somehow affecting your privileges on other object types.  Your privileges on schemas will not influence (directly) your permissions on tables.  Neither to grant additional privileges or to block them - say if you don't have usage on schema but do have select on a contained table.  Corner-cases that do behave this way notwithstanding - it isn't reliable.

David J.