SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Redshift Destination Sync Fails with "Permission Denied for Schema" Error

Issue

When syncing data from Segment sources to a Redshift destination, the sync fails with the error: "ERROR: permission denied for schema [schema_name] (SQLSTATE 42501)". The Segment UI may display: "Data could not be loaded due to an internal error."

 

Product

Segment Destinations

 

Environment

Segment Console

 

Cause

The Segment database user does not have the necessary permissions to access the target schema(s) in the Redshift cluster. This prevents the sync process from inspecting tables and loading data.

 

Resolution

  1. Grant the Segment user permission to create schemas in the target database (if schema management is handled by Segment):
    GRANT CREATE ON DATABASE <database_name> TO <segment_user>;
  2. Grant usage and create access on the relevant schema(s):
    GRANT USAGE, CREATE ON SCHEMA <schema_name> TO <segment_user>;
  3. Grant access to current and future tables within the schema(s):
    GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA <schema_name> TO <segment_user>;
    ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO <segment_user>;
  4. After updating permissions, allow the next scheduled sync to run.

 

Additional Information

If multiple schemas are used, repeat the permission grants for each schema required by your Segment sync.

Have more questions? Submit a request
Powered by Zendesk