mowienay
mowienay

Reputation: 1354

How to grant user access to one table in a specific schema in Redshift

Logged in as the superuser, how can I grant user access to a specific table under a specific schema.

I tried this

GRANT SELECT on TABLE this_schema.my_table TO my_user

But when I login as my_user I can't select from the table. I don't want my_user to have access to any other tables in this_schema.

Is this possible?

Upvotes: 7

Views: 35780

Answers (3)

Zichen Wang
Zichen Wang

Reputation: 1374

Without creating user group, you can do:

GRANT SELECT ON TABLE my_table IN SCHEMA this_schema TO my_user;

Upvotes: 0

Deepak Sonawane
Deepak Sonawane

Reputation: 372

Yes its possible. You can use following command, to give select access of specific table to specific user.

GRANT SELECT on SCHEMA_NAME.TABLE_NAME TO USER_NAME;

NOTE: user still list and describe other tables in the given schema.

Upvotes: 14

Jon Scott
Jon Scott

Reputation: 4354

You need to grant usage on the schema as well

GRANT USAGE ON SCHEMA this_schema TO GROUP my_user;

Upvotes: 13

Related Questions