Redshift

Overview

Sortment lets you pull data stored in your Redshift warehouse and use it to create schema.

📘 Connecting Sortment to Redshift requires some setup in both platforms. It's recommended to set up a service account with the correct permissions in Redshift before configuring the connection in Sortment.

Connection configuration

To get started, select Redshift on Data connections page and and follow the steps below.

Connection type

Right now, Sortment supports direct connection over public internet. Since data is encrypted in transit via TLS, a direct connection is suitable for most use cases.

Configure your source

Enter the following required fields into Sortment:

  • Host: The hostname of your Redshift cluster. The hostname can be found by visiting the Redshift web console, navigating to the Clusters panel, and clicking your cluster. Copy the Endpoint string, excluding the port and database name.

  • Port: The port number of your Redshift cluster. The default is 5439, but yours may be different. To confirm, visit the Redshift web console, navigate to the Clusters panel, and click your cluster. The port number is shown in the Properties tab.

  • Database: The name of the database in your Redshift cluster. Most clusters have only one database. Visit the Redshift web console, navigate to the Clusters panel, and click your cluster. The database name is shown in the Properties tab.

  • Schema: The name of the schema in your Redshift cluster where Sortment will get write access for creating audiences and campaigns.

User credentials

Enter the following fields into Sortment:

  • Username: This can be your personal Redshift login or a dedicated user for Sortment. At minimum, this user must have read and write access to your data for respective databases and schema.

  • Password: This is the password for the user specified above.

-- Step 1: Generate Redshift User
CREATE USER <user_name> PASSWORD <user_password>;

-- Step 2: Give Read Access to All Schemas
-- Note: You will need to run these commands for each schema.
-- Replace 'schema_name' with your actual schema names.
GRANT SELECT ON ALL TABLES IN SCHEMA schema_name TO <user_name>;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT ON TABLES TO <user_name>;

-- Step 3: Create New Schema
CREATE SCHEMA <new_schema_name> AUTHORIZATION <user_name>;

-- Step 4: Give Write Access to This New Schema
GRANT INSERT, UPDATE, DELETE, SELECT ON ALL TABLES IN SCHEMA <new_schema_name> TO <user_name>;
ALTER DEFAULT PRIVILEGES IN SCHEMA <new_schema_name> GRANT INSERT, UPDATE, DELETE, SELECT ON TABLES TO <user_name>;

Test connection

When setting up a source for the first time, Sortment validates the following:

  • Network connectivity

  • Redshift credentials

  • Permission to list schemas and tables

  • Permission to write to the schema

All configurations must pass them for uninterrupted access to Sortment. Some sources may initially fail connection tests due to timeouts. Once a connection is established, subsequent API requests should happen more quickly, so it's best to retry tests if they first fail. You can do this by clicking Continue again.

If you've retried the tests and verified your credentials are correct but it is still failing, reach out to support@sortment.com

Last updated