Skip to content

Amazon Redshift

BUILDING Destination · built and tested, not yet verified against production accounts. Contact us before relying on it.

PortPilot loads each synced table into a Redshift table. Rows are written to an S3 staging bucket you own, then loaded with Redshift’s COPY command using an IAM role attached to your cluster. Nested objects and arrays go into SUPER columns. Tables and new columns are created automatically.

On PortPilot-hosted deployments, PortPilot writes the staging files with an AWS access key you provide. With a bring-your-own-cloud deployment on AWS, it can use the job’s own IAM role instead.

  1. Create a database user and let it create tables in the target schema:

    CREATE USER portpilot PASSWORD '<strong password>';
    GRANT CREATE, USAGE ON SCHEMA public TO portpilot;
    GRANT TEMP ON DATABASE <database> TO portpilot;

    TEMP is needed for upserts. If PortPilot writes to existing tables, grant SELECT, INSERT, DELETE on them too.

  2. Create a staging bucket in the cluster’s region. Add a lifecycle rule that expires objects under pipestream-staging/ after a few days (files from failed loads are kept for debugging).

  3. Let PortPilot write to the bucket with s3:PutObject and s3:DeleteObject on arn:aws:s3:::<bucket>/pipestream-staging/*:

    • Hosted: create an IAM user with that policy and an access key for it.
    • AWS BYOC: attach the policy to the PortPilot job’s IAM role and leave the key fields empty.
  4. Let Redshift read the bucket. Create an IAM role Redshift can assume, with s3:GetObject on the same prefix, and associate it with the cluster or workgroup. Note its ARN.

  5. Allow network access from the PortPilot job to the cluster endpoint (security group, port 5439).

In the app, go to Destinations → New destination → Amazon Redshift and click Test connection after filling in:

Field Required Default Description
host Yes — Cluster or workgroup endpoint hostname.
port Yes 5439 Port.
database Yes — Target database.
user Yes — The user created above.
password Yes — Stored write-only in the data plane’s secret store.
s3_staging_bucket Yes — Bucket for staging files.
iam_role Yes — ARN of the role Redshift uses for COPY (s3:GetObject on the bucket).
access_key_id Hosted: yes — Access key with put/delete on the staging prefix. Leave empty on AWS BYOC to use the job’s IAM role.
secret_access_key With access_key_id — Secret for the access key. Stored write-only.
region No — Staging bucket region, e.g. us-east-1.

The connection test writes and deletes a small object in the staging prefix to check access.

  • Tables are named after the source table or stream and created on the first load. Table and column names are stored in lower case.
  • Names are lower-cased and quoted, so reserved words such as order or user and names with spaces work: a source column First Name lands as "first name".
  • COPY matches JSON keys to columns regardless of case.
  • New columns are added with ALTER TABLE … ADD COLUMN. Existing columns are never changed or dropped.
  • No PortPilot metadata columns are added.
PortPilot typeDestination type
integerBIGINT
numberDOUBLE PRECISION
booleanBOOLEAN
objectSUPER
arraySUPER
stringVARCHAR(65535)
Write mode When What happens
Upsert Tables with a primary key COPY into a temporary table, then delete matching target rows and insert the staged ones in one transaction. Readers never see rows missing.
Replace Full reads of tables without a primary key Truncate, then COPY.
Append Incremental reads of tables without a primary key COPY.

The staging file is deleted after a successful load.

  • Hosted deployments need an access key. Hosted jobs run on Google Cloud, so they can’t use an AWS role for staging. Rotate the key periodically and update the destination.
  • Strings over 65,535 bytes fail the load. Long text fields (descriptions, HTML bodies) can hit this.
  • COPY permission errors (S3ServiceException: Access Denied) mean the role in iam_role can’t read the staging prefix, or isn’t associated with the cluster.
  • Upserts on very large syncs delete and re-insert every changed row. Run VACUUM on heavily updated tables, or let automatic vacuum keep up.