Redshift Data Graph User Access Permissions
You can set up the Data Graph in such a way that Segment has access to 2 databases:
- The first database has write access for storing Reverse ETL checkpoints databases
- The second database has read access
Permissions Option 1
Database
Create a separate databse for Segment usage (for example, segment_workspace
). This will have the following schemas:
- Profiles Sync Schema (for example:
profiles_sync
)- Segment will add Profiles Sync tables to this schema
__segment_reverse_etl
schema- Segment will create the
__segment_reverse_etl
schema to add checksum tables for Linked/Data Graph
- Segment will create the
User
Have 2 roles assigned to the Segment user:
- Profiles Sync role (for example,
segment_profiles_sync_role
) - Linked/Data Graph role (for example,
segment_linked_role
)
Roles
Profiles Sync role (segment_profiles_sync_role
)
The profiles sync role has the following permissions:
- Read and write access to the Profiles Sync schema (for example,
profiles_sync
)
Linked/Data Graph role (segment_linked_role
)
This role has the following permissions:
- Write access to the Segment Database (for example,
segment_workspace
) to create the__segment_reverse_etl
schema in it - Read access to Profiles Sync schema (for example,
profiles_sync
) to read Segment Profile and Event tables that are created by Profiles Sync - Read access to full user data schema (for example, devices schema), or read access to specific tables in the user data schema (for example,
user_devices
table ordevice_locations
table)
Permissions Option 2
Database
Create a single database for Profiles Sync & Linked usage (for example, segment_workspace
). This has the following schemas:
- Profiles Sync schema (for example, profiles_sync)
- Segment adds Profiles Sync tables to this schema
__segment_reverse_etl
schema- Segment creates the
__segment_reverse_etl
schema to add checksum tables for Linked/Data Graph
- Segment creates the
- End User Entity Details schema (for example, devices)
- Segment has read access to these tables
User
Have these 2 roles assigned to the Segment user:
- Profiles Sync role (for example,
segment_profiles_sync_role
) - Linked/Data Graph role (for example,
segment_linked_role
)
Roles
Profiles Sync role (segment_profiles_sync_role
)
This role has the following permissions:
- Read and write access to the Profiles Sync schema (for example,
profiles_sync
)
Linked/Data Graph role (segment_linked_role)
This role has the following permissions:
- Write access to Database (for example,
segment_workspace
) to create the__segment_reverse_etl
schema in it - Read access to Profiles Sync schema (for example,
profiles_sync
) to read Segment Profile/Event tables that are created by Profiles Sync - Read access to full user data schema (for example, devices schema) or read access to specific tables in the user data schema (for example,
user_devices
table ordevice_locations
table)
Setup Guide
To set your Data Graph so that Segment has access to 2 databases within your Redshift Cluster:
Step 1: Create the new Segment database
Run:
--Create new Segment database
CREATE DATABASE segment_workspace;
Step 2: Create the Profiles Sync role
-
Switch to the Segment database in the Redshift query editor. Create a new Profiles Sync role.
--create new Profiles Sync role CREATE ROLE segment_profiles_sync_role;
-
Create a new Profiles Sync schema.
--create new Profiles Sync schema CREATE SCHEMA "profiles_sync";
-
Assign the Profiles Sync role with read and write access to the Profiles Sync schema.
--grant Profiles Sync role write access to Profiles Sync schema GRANT ALL ON SCHEMA profiles_sync TO ROLE segment_profiles_sync_role;
Step 3: Create the Linked/Data Graph role
-
Create a new Linked/Data Graph role.
--create new Linked/Data Graph role CREATE ROLE segment_linked_role;
-
Assign the Linked/Data Graph role with write access to the Segment database (created in Step 1) for permissions to create a new
__segment_reverse_etl
schema.--grant Linked role write access to segment_workspace DATABASE to create __segment_reverse_etl SCHEMA GRANT CREATE ON DATABASE segment_workspace TO ROLE segment_linked_role;
-
Assign the Linked/Data Graph role with read access to the Profiles Sync schema to access the Segment Profile/Event data.
--grant Linked role read access to Profiles Sync SCHEMA GRANT USAGE ON SCHEMA "profiles_sync" TO ROLE segment_linked_role; -- Grant read access to existing Profiles Sync tables GRANT SELECT ON ALL TABLES IN SCHEMA profiles_sync TO ROLE segment_linked_role; -- Ensure future Profiles Sync tables also allow read access ALTER DEFAULT PRIVILEGES IN SCHEMA profiles_sync GRANT SELECT ON TABLES TO ROLE segment_linked_role;
-
Assign the Linked/Data Graph role read access to end user Entity Data.
- For Permissions Option 1:
-
Switch to the end user database in the query editor. Assign the Linked/Data Graph role with read access to user data.
--grant Linked role read access to user entity tables in DATABASE user_database GRANT USAGE ON SCHEMA devices TO ROLE segment_linked_role;
-
Select 1 of the options below:
a. (Option 1):: Assign the Linked/Data Graph role with read access to full user data schema
--for access to the full devices SCHEMA GRANT SELECT ON ALL TABLES IN SCHEMA devices TO ROLE segment_linked_role; --ensure future user tables also allow read access ALTER DEFAULT PRIVILEGES IN SCHEMA devices GRANT SELECT ON TABLES TO ROLE segment_linked_role;
b. (Option 2): Assign the Linked/Data Graph role with read access to specific tables in the user data schema
--for access to select tables in the devices SCHEMA GRANT SELECT ON devices.user_devices TO ROLE segment_linked_role; GRANT SELECT ON devices.device_locations TO ROLE segment_linked_role;
-
- For permissions option 2:
-
Stay in the Segment Database within the Redshift Query Editor. Assign the Linked/Data Graph role with read access to user data.
--grant Linked role read access to user entity tables in DATABASE segment_workspace GRANT USAGE ON SCHEMA devices TO ROLE segment_linked_role;
-
Select 1 of the options:
a. (Option 1): Assign the Linked/Data Graph role with read access to the full user data schema.
--for access to the full devices SCHEMA GRANT SELECT ON ALL TABLES IN SCHEMA devices TO ROLE segment_linked_role; --ensure future user tables also allow read access ALTER DEFAULT PRIVILEGES IN SCHEMA devices GRANT SELECT ON TABLES TO ROLE segment_linked_role;
b. (Option 2): Assign the Linked/Data Graph role with read access to specific tables in the user data schema
--for access to select tables in the devices SCHEMA GRANT SELECT ON devices.user_devices TO ROLE segment_linked_role; GRANT SELECT ON devices.device_locations TO ROLE segment_linked_role;
-
- For Permissions Option 1:
Step 4: Create a new Segment user
- Switch back to the Segment database in the query editor.
--create new USER
CREATE USER segment_user PASSWORD 'Abc123';
Step 5: Assign both the Profiles Sync role (from Step 2) and the Linked/Data Graph role (from Step 3) to the user
--assign both roles to USER
GRANT ROLE segment_profiles_sync_role TO segment_user; --Assign Profiles Sync Role to user
GRANT ROLE segment_linked_role TO segment_user; --Assign Linked/Data Graph Role to user
This page was last modified: 14 May 2025
Need support?
Questions? Problems? Need more info? Contact Segment Support for assistance!