Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
Data type mapping
The extension maps Redshift result types to DuckDB types as shown in the following table.
| Redshift type | DuckDB type | Notes |
|---|---|---|
|
|
None |
|
|
None |
|
|
|
|
|
None |
|
|
Sent with 8 significant digits, so a |
|
|
Exact. |
|
|
Precision 1 to 38. The extension keeps the Redshift result types. |
|
|
The extension removes trailing blanks. |
|
|
The extension keeps trailing blanks. |
|
|
Its JSON text. |
|
|
None |
|
|
Redshift stores |
|
|
Values from a table arrive with offset |
|
|
Within DuckDB's range. |
|
|
Display and computation follow DuckDB's
|
|
|
None |
Unqualified |
|
The Redshift interval text, such as |
Qualified |
Refused |
Convert it in the Redshift SQL. |
Any other type |
Refused |
Cast it to a supported type in the Redshift SQL. |
The system-catalog types name and "char" arrive as
VARCHAR. A value that doesn't fit its DuckDB type fails the
query rather than being rounded or clamped.
Every new connection sets the session's time zone to UTC, its date style to ISO,
MDY, its interval style to postgres, and its float output to the most
digits Redshift gives, so values arrive in one form. Changing one of these with
SET or RESET through redshift_query, including the
interval style, which changes the interval text, changes how values arrive for the rest
of that session, so leave them as they are.
The known limitations are as follows.
-
The extension refuses qualified
INTERVAL,GEOMETRY,GEOGRAPHY,HLLSKETCH, and any other unmapped type at bind, before Redshift runs the statement. Convert them in the Redshift SQL, for exampleST_AsText(geom)for a geometry orcol::VARCHARfor an interval. -
REALvalues are sent with 8 significant digits, so some 32-bit values arrive as the neighboringFLOAT;DOUBLE PRECISIONvalues arrive exactly. To read aREALexactly, cast it toDOUBLE PRECISIONin the Redshift SQL. A finite value whose printed form overflows fails the query rather than arriving as infinity. -
oidcolumns arrive asINTEGER, and a value above 2147483647 fails. Cast it with::bigintin the Redshift SQL. -
A
TIMESTAMPorTIMESTAMPTZafter294247-01-10 04:00:54.775806, the end of DuckDB's range, up to Redshift's maximum of294276-12-31, and a storedTIMESTAMP'infinity', fail the query. For a write, the failure comes after the statement has run, so check its effects before you run it again. -
CHARvalues lose their trailing blanks, so DuckDB compares and measures them as Redshift does, but some expressions still differ because DuckDB sees the value without Redshift's padding. ACHAR(25)holding'GERMANY'matchesLIKE '%Y'in DuckDB but not in Redshift,octet_lengthis 7 in DuckDB and 25 in Redshift, and a comparison with a blank-padded literal such as= 'GERMANY 'matches in Redshift but not DuckDB. Run such an expression in the Redshift SQL. A trailing tab is kept, and a case-insensitive Redshift collation doesn't carry over to DuckDB.
redshift_query returns the types Redshift gives the result, which aren't
always the ones DuckDB would give the same expression. For example, an
aggregate avg of a NUMERIC(10,2) column is
DECIMAL(38,2), a window avg(col) OVER (...) keeps
DECIMAL(10,2), and NUMERIC(10,2) / 3 is DECIMAL(12,4),
where DuckDB would give DOUBLE. These results are truncated,
so the average of 10, 20, and 20 arrives as 16.66, and a bare
::numeric is NUMERIC(18,0) in Redshift and
DECIMAL(18,3) in DuckDB. Cast in the Redshift SQL to
choose the type.
-
A window
SUMover aDECIMALcolumn fails when the total needs more digits than the column's precision, because Redshift declares the result with the column's own precision and scale. Cast the column or the result wider, such asSUM(col::DECIMAL(38,2)) OVER (...). -
A table Redshift creates with
CREATE TABLE AScan hold a widerDECIMALthan the query reported, so reading it back gives the wider type. Declare the columns instead of deriving them to avoid it. -
Repeated or unnamed result columns, such as
SELECT a.id, b.id, arrive with DuckDB's suffixes (idandid_1). Name each column withASin the Redshift SQL to choose the names.