# Redshift

### Connection configuration reference

Install the following package:

```bash
pip install soda-redshift
```

#### Data source YAML

**Create the config file:**

```shellscript
soda data-source create -f ds_config.yml
```

The data source configuration YAML should look like the following:

{% code title="ds\_config.yml" %}

```yaml
type: redshift
name: my_redshift
connection:
  host: ${env.REDSHIFT_HOST}
  port: 5439
  database: ${env.REDSHIFT_DB}
  user: ${env.REDSHIFT_USER}
  
  # optional
  password: ${env.REDSHIFT_PW}
  access_key_id: ${env.REDSHIFT_AWS_ACCESS_KEY_ID}
  secret_access_key: ${env.REDSHIFT_AWS_SECRET_ACCESS_KEY}
  session_token: ${env.REDSHIFT_AWS_SESSION_TOKEN}
  role_arn: ${env.REDSHIFT_ROLE_ARN} # e.g., arn:aws:iam::123456789012:role/MyRole
  region: ${env.REDSHIFT_REGION} # e.g., us-east-1
  profile_name: ${env.REDSHIFT_AWS_PROFILE}
  cluster_identifier: ${env.REDSHIFT_CLUSTER_ID}
```

{% endcode %}

#### Connection test

Test the data source connection:

```bash
soda data-source test -ds ds_config.yml
```

***

### Case sensitivity

{% hint style="warning" %}
In [Soda v3](https://app.gitbook.com/o/ig9n9VJPAFRSFLtZKVB2/s/oV0A6Eua8LUIyWgHxsjf/), Soda only supports case-insensitive identifiers for this data source. **Users migrating from v3 to v4 might have to account for case** since **Soda v4 enforces case-sensitive identifiers**.
{% endhint %}

Redshift is usually case-insensitive and interprets all identifiers (e.g. table and column names) as lower case regardless of the original input. However, **Soda enforces case-sensitive identifiers for its sessions**.

Starting with **Soda v4**, all queries executed against Redshift are now run with **`enable_case_sensitive_identifier = True`**, regardless of your database’s default setting. This ensures consistent handling of table and column names, including those containing uppercase characters.

If you previously relied on case-insensitive behavior (the default in Soda v3), you may need to **review and update any custom SQL**, filters, or references to identifiers to ensure they match the exact case used in your Redshift schema.

This change prevents onboarding issues for mixed-case identifiers, but it also means **all SQL executed by Soda is now case sensitive**.

{% hint style="warning" %}
**Text truncation in Diagnostics Warehouse**

When using **Redshift** as your Diagnostics Warehouse target, **large text values may be truncated** (65,535 char limit) **or produce hashing collisions** when stored in Soda result tables.

> To learn more, go to [limitations & edge cases](https://docs.soda.io/reference/data-source-reference-for-soda-core/broken-reference) in Diagnostics Warehouse data sources.
> {% endhint %}

<br>

***

{% if (visitor.claims.plan === 'datasetStandard')%}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Free license** documentation. Learn more about [documentation-access-and-licensing](https://docs.soda.io/reference/documentation-access-and-licensing "mention").
{% endhint %}
{% endif %}

{% if (visitor.claims.plan === 'enterprise')%}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Team license** documentation. Learn more about [documentation-access-and-licensing](https://docs.soda.io/reference/documentation-access-and-licensing "mention").
{% endhint %}
{% endif %}

{% if (visitor.claims.plan === 'enterpriseUserBased')%}
{% hint style="success" %}
You are **logged in to Soda** and seeing the **Enterprise license** documentation. Learn more about [documentation-access-and-licensing](https://docs.soda.io/reference/documentation-access-and-licensing "mention").
{% endhint %}
{% endif %}

{% if !(visitor.claims.plan === 'enterprise' || visitor.claims.plan === 'enterpriseUserBased' || visitor.claims.plan === 'datasetStandard')%}
{% hint style="info" %}
You are **not logged in to Soda** and are viewing the default public documentation. Learn more about [documentation-access-and-licensing](https://docs.soda.io/reference/documentation-access-and-licensing "mention").
{% endhint %}
{% endif %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.soda.io/reference/data-source-reference-for-soda-core/amazon-redshift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
