> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Redshift as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/redshift > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Configuration](#configuration) - [Verify the server certificate](#verify-the-server-certificate) - [Selecting columns](#selecting-columns) - [Troubleshooting](#troubleshooting) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) Let AI connect your sources for you Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you The Redshift connector can link your database tables to PostHog. To link Redshift: 1. Go to the [Data pipeline page](https://app.posthog.com/data-management/sources) and the sources tab in PostHog 2. Click **New source** and select Redshift 3. Enter your database connection details: - **Host:** The hostname or IP of your Redshift cluster like `my-cluster.abc123.us-east-1.redshift.amazonaws.com`. - **Port:** The port your Redshift cluster is listening on. The default is `5439`. - **Database:** The name of the database you want like `analytics_db`. - **User:** The username with the necessary permissions to access the database. - **Password:** The password for the user. - **Schema:** (Optional) The schema for your database. Leave blank to browse and sync tables from all schemas, or specify one to limit the selection. The default is `public`. - **TLS fields:** (Optional) Verify the server certificate, or add a certificate authority. See [Verify the server certificate](#verify-the-server-certificate). 4. Click **Next** The data warehouse then starts syncing your Redshift data. You can see details and progress in the [sources tab](https://app.posthog.com/data-management/sources). > **Permissions:** The Redshift source only requires read permissions on the schemas and tables you intend to sync. ## Configuration | Option | Description | | --- | --- | | `Connection string (optional)` **Type:** text **Required:** False | | | `Host` **Type:** text **Required:** True | Must be reachable from the public internet. Add PostHog's egress IP addresses to your firewall allowlist (see the docs above) and use a public host. `localhost` and private IPs (10.x, 172.16-31.x, 192.168.x) can't be reached. For a database that can't be exposed publicly, enable the SSH tunnel below. | | `Port` **Type:** number **Required:** True | | | `Database` **Type:** text **Required:** True | | | `User` **Type:** text **Required:** True | | | `Password` **Type:** password **Required:** True | | | `Schema` **Type:** text **Required:** False | | | `Verify the server certificate?` **Type:** select **Required:** True | Check that your database's TLS certificate comes from a trusted authority and matches the host. Through an SSH tunnel we check the certificate chain but not the hostname, because the tunnel presents your database on a local address. | | `Certificate authority (optional)` **Type:** textarea **Required:** False | The PEM certificate of the authority that signed your database's certificate. Add it when your database uses a private authority or a self-signed certificate. Adding one turns on certificate verification. | | `Use SSH tunnel?` **Type:** ssh-tunnel **Required:** False | | ## Verify the server certificate By default, PostHog encrypts the connection to your database but does not check its certificate. To make sure PostHog connects to your real database, set these fields when you link the source: - **Verify the server certificate?** Checks that your database's TLS certificate comes from a trusted authority and matches the host you entered. Off by default. - **Certificate authority (optional):** The PEM certificate of the authority that signed your database's certificate. Add it when your database uses a private authority or a self-signed certificate. Adding one turns on verification, even when the toggle above is off. Without it, PostHog checks against a standard set of public authorities. Through an SSH tunnel, PostHog checks that the certificate comes from a trusted authority, but not that it matches the host. The tunnel presents your database on a local address, so the host name can't match. If you leave all of these fields empty, the connection is encrypted but the certificate is not checked. ### Certificate errors PostHog stops syncing on these errors, because retrying fails the same way until you change the source: - "PostHog could not verify your database's TLS certificate. Either an authority PostHog trusts did not sign it, or it does not match the host. Add the authority that signed it, check the host, or turn off certificate verification and remove the certificate authority." - "Your database's TLS certificate does not match the host you entered. Use the hostname the certificate was issued for, or turn off certificate verification and remove the certificate authority." After you fix the certificate or the source settings, re-enable the sync. ## Selecting columns By default, PostHog syncs all columns from each table. To sync only specific columns: 1. During source setup, click **Columns** next to any table in the table picker. 2. Uncheck columns you don't want to sync. 3. Primary key columns and the incremental sync field (if configured) are always synced and cannot be disabled. You can also change column selection after setup: 1. Go to the [sources tab](https://app.posthog.com/data-management/sources) and click your Redshift source. 2. Click **Configure** next to any schema. 3. Under **Columns**, select which columns to sync. **Adding columns to existing syncs** When you add columns to a schema using incremental or append sync, PostHog prompts you to choose: - **Sync forward only** - New columns are populated only for future data. Existing rows show `NULL` for the new columns. - **Full resync** - Triggers a complete resync to backfill the new columns for all rows. ## Troubleshooting ### No primary key detected For **Incremental replication**, open the table's sync method settings and select one or more **Primary key** columns. Choose columns whose combined values uniquely identify each row and contain no null values. You also need an incremental field to track new or updated rows. Redshift [materialized views](https://docs.aws.amazon.com/redshift/latest/dg/materialized-view-create-sql-command.html) cannot declare primary keys. To sync a materialized view incrementally, select the key columns manually in PostHog. This selection does not add a constraint in Redshift. Redshift [does not enforce primary key constraints](https://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html), so check that the selected columns are unique even when PostHog detects a declared key. If no columns uniquely identify each row, choose **Full table replication** (full refresh) instead. #### Inbound IP addresses We use a set of IP addresses to access your instance. To ensure this connector works, add these IPs to your inbound security rules: | US | EU | | --- | --- | | 44.205.89.55 | 3.75.65.221 | | 52.4.194.122 | 18.197.246.42 | | 44.208.188.173 | 3.120.223.253 | | 3.41.215.48/28 | 3.40.9.80/28 |