Prashant K
Prashant K

Reputation: 11

Unable to query AWS datashare

Today I created datashare but when I try to run query on it. I get below error:

 Query: select * from postgress_home_db.staging_datashare.site limit 100
    ERROR: Publicly accessible consumer cannot access object in the database.

I tried to search reason behind it but did not get anything. Below are the queries I used to create datashare.

Producer cluster:
1. CREATE DATASHARE postgres_home_ds;
2. ALTER DATASHARE postgres_home_ds ADD SCHEMA postgres_home_pod;
3. GRANT USAGE ON DATASHARE postgres_home_ds to NAMESPACE 'xyz'
Consumer Cluster:
CREATE DATABASE postgress_home_db from DATASHARE postgres_home_ds of NAMESPACE 'abc'
CREATE EXTERNAL SCHEMA postgress_home_datashare FROM REDSHIFT DATABASE 'postgress_home_db' SCHEMA 'staging_datashare'

Upvotes: 0

Views: 1683

Answers (1)

Deeptimayee Khatua
Deeptimayee Khatua

Reputation: 11

I was able to fix the issue by setting PUBLICACCESSIBLE=True ALTER DATASHARE datashare_name SET PUBLICACCESSIBLE=True

Upvotes: 1

Related Questions