> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-docs-fix-500-query-results.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Redshift

> Connect to Redshift clusters and Serverless over the PostgreSQL wire protocol, with DISTKEY and SORTKEY metadata display

Redshift speaks the PostgreSQL wire protocol and uses the same bundled libpq driver, so the [PostgreSQL](/databases/postgresql) page covers the form and the URL. This page covers where a columnar warehouse differs: distribution style and sort keys in table info, external schemas, and a read-only structure tab.

## Connection settings

| Field        | Default | Notes                                                                                                                           |
| ------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Host**     | -       | The cluster endpoint, `my-cluster.abc123xyz.us-east-1.redshift.amazonaws.com` in shape, or the workgroup endpoint on Serverless |
| **Port**     | `5439`  | Same for a provisioned cluster and for Serverless                                                                               |
| **Database** | `dev`   | **Required**; every cluster is created with a `dev` database                                                                    |

Fill in the form and click **Save & Connect**. New connections default to SSL mode **Preferred**, and there is no version gate: any cluster AWS still runs will connect.

<Info>
  AWS IAM authentication is not available for Redshift connections, unlike MySQL and PostgreSQL. Use a database username and password. For a cluster that is not publicly reachable, put it behind an [SSH tunnel](/connections/ssh-tunneling) on a bastion in the VPC.
</Info>

## Connection URL

```text theme={null}
redshift://user:password@my-cluster.abc123xyz.us-east-1.redshift.amazonaws.com:5439/dev
```

See [Connection URL Reference](/connections/urls).

## Schemas and metadata

The default schema is `public`, and table metadata comes from `svv_table_info`: distribution style, sort keys, and table size. `dev` is listed like any other database; only `padb_harvest` is marked as a system database. A tab bound to a database other than the connection's active one opens a second connection for it, exactly as on [PostgreSQL](/databases/postgresql#cross-database-tabs).

Table DDL includes DISTKEY, SORTKEY, DISTSTYLE, and ENCODE directives. Foreign keys are shown but not enforced by the server.

<Frame caption="Distribution style and sort keys in table info">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/redshift-table-info-sortkeys.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=814d013865438167c9eddb7c6b57cede" alt="Redshift table info showing distribution style and sort keys" width="1560" height="960" data-path="images/redshift-table-info-sortkeys.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/redshift-table-info-sortkeys-dark.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=d5a6309a36fc75613961cab488f26ead" alt="Redshift table info showing distribution style and sort keys" width="1560" height="960" data-path="images/redshift-table-info-sortkeys-dark.png" />
</Frame>

## External schemas

Schemas created with `CREATE EXTERNAL SCHEMA` are listed beside regular ones and marked **External**, with an external icon on their tables. Spectrum over S3, federated query, cross-database references, and datashare consumers all land here.

Their tables are read-only: Redshift takes no `UPDATE` or `DELETE` on them and they carry no primary key, so cell editing, adding rows, and deleting rows are off. Browsing, filtering, sorting, and export work as usual.

## Backup

**Backup Dump** and **Restore Dump** run `pg_dump` and `pg_restore` against Redshift, the only engine besides PostgreSQL where they are offered. See [Backup & Restore](/features/backup-restore).

## Limitations

* No structure editing. The structure tab is read-only for Redshift; run `ALTER TABLE` in the SQL editor.
* No indexes, enums, sequences, or triggers. DISTKEY and SORTKEY do the work indexes would.
* Foreign keys are informational only. Nothing stops a row that violates one; validate in the load job.
* No Maintenance menu. Run `VACUUM` and `ANALYZE` from the SQL editor.
* External tables show no row count, and their column types come through as the external catalog reports them, such as `varchar(65535)` or `array<varchar(20)>`.

## Troubleshooting

**Connection refused**: check the security group allows port 5439, the cluster is publicly accessible or reachable through a tunnel, and it is not paused.

**FATAL: password authentication failed for user "…"**: the cluster rejected the credentials. Verify the master username and password in the AWS Console, and that the user exists in this database.

**Slow queries**: check distribution with `SELECT * FROM svv_table_info WHERE "table" = 'your_table'`, run `ANALYZE` to refresh stats, and match SORTKEY to the predicates you filter and join on.
