aws-samples / aws-samples/amazon-redshift-dynamic-data-masking
Object in a different schema
- Dominant language
- PLpgSQL
- Stars
- 21
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
within the same database, I created the view in a different schema
`create or replace view "target".customer as (
select c.id,
f_mask_varchar(c.first_name) first_name,
f_mask_varchar(c.last_name) last_name,
f_mask_varchar(c.login) login,
c.email_address
from "source".customer_raw c
) with no schema binding;`
and then I ran
`grant usage on schema "prolaio-target" to analyst_test;`
and finally once querying the target view as the analyst_test user I get the error
`ERROR: permission denied for schema source [ErrorId: 1-63df96c7-2cd9dfc8346e71ac66bec3da]`
Does this mean that in fact the approach shown does not work if the view is created in a different schema than the one where the raw table exist?
Contributor guide
Research direction
Start by reproducing the reported CREATE VIEW, GRANT USAGE, and query statements in Amazon Redshift with separate source and target schemas. Check the permissions required for querying a cross-schema view and compare them with the example; done means confirming whether the approach works and documenting the required grants or a supported alternative.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- authorization, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100