redshift error when grant select on table: Operation not supported on external tables

0

I have a redshift table that I would like to grant access to a user, if I run: GRANT SELECT ON ALL TABLES IN SCHEMA schema_name to user_name; it works,

however, if I run: GRANT SELECT ON schema_name.table_name to user_name; I got the following error: ERROR: Operation not supported on external tables

Any ideas why? Thanks!

demandé il y a un an1490 vues
1 réponse
0
Réponse acceptée

You are seeing this error since SELECT is not a supported privilege type for external schema. Supported privilege are CREATE, ALTER, DROP. Refer following doc for details. https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html

GRANT { { CREATE | ALTER | DROP }  [, ...] | ALL [ PRIVILEGES ] }
    ON EXTERNAL SCHEMA schema_name [, ...]
    TO { IAM_ROLE iam_role } [, ...] [ WITH GRANT OPTION ]   

If you want to grant SELECT privilege for tables in an external schema, use the following syntax.

GRANT { { SELECT | ALTER | DROP | DELETE | INSERT }  [, ...] | ALL [ PRIVILEGES ] }
    ON EXTERNAL TABLE schema_name.table_name [, ...]
    TO { { IAM_ROLE iam_role } [, ...] | PUBLIC } [ WITH GRANT OPTION ]
AWS
Yota_H
répondu il y a un an
profile picture
EXPERT
vérifié il y a un mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions