Amazon Redshift Reference
Authentication options and data type handling for Redshift connections.
Authentication
| Connection parameter | Environment variable |
|---|---|
user | DATACONTRACT_REDSHIFT_USERNAME |
password | DATACONTRACT_REDSHIFT_PASSWORD |
host, port (default 5439), database, and schema come from the contract's servers block.
IAM-based authentication (region / access key / role ARN) is not currently supported for Redshift, because ibis connects through the generic Postgres backend rather than a Redshift-specific driver.
Data types
Importing
datacontract import sql --dialect redshift maps DDL types like the Postgres dialect: VARCHAR/CHAR/TEXT → string, integer types → integer, NUMERIC/DECIMAL/REAL/DOUBLE PRECISION → number, BOOLEAN → boolean, DATE → date, TIME → time, TIMESTAMP/TIMESTAMP WITH TIME ZONE → timestamp. Redshift-specific types without a portable equivalent (SUPER, GEOMETRY) get no logicalType; the physicalType is still written.
Testing
Redshift supports native type introspection: the declared physicalType is checked against information_schema.columns. decimal and numeric are interchangeable, as are timezone variants of timestamps; length/precision is only enforced when declared. A physicalType that can't be interpreted falls back to the logical type category comparison.
Logical type mapping
When no physicalType is declared, the CLI derives the native type from the logicalType — for example in datacontract export sql and the dbt exports. This table is generated from the converter in the CLI's code:
logicalType | Redshift type |
|---|---|
string | text |
integer | integer |
number | numeric |
boolean | boolean |
date | date |
timestamp | timestamptz |
time | time |
object | jsonb |
array | text[] |