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
Redshift extension for DuckDB
The Redshift extension for DuckDB runs Redshift SQL from a DuckDB session and brings the results back into that session. From an existing DuckDB session, if you have data in Amazon S3, Amazon S3 Tables, or Amazon Redshift, you can run queries on Amazon Redshift directly. The query runs on Redshift with Redshift SQL syntax and semantics. The results come back to the DuckDB session as DuckDB tables that you can join with local data, save as tables, or write to local files.
A single DuckDB session is limited by the memory and compute of the machine it runs on. A scan or join that doesn't fit fails or runs slowly. The usual fix is to leave DuckDB for a separate engine, which means setting up infrastructure, moving your data into it, and rewriting your work. The extension removes that step. From the same DuckDB session, you hand the query that outgrew your machine to Amazon Redshift. It runs across distributed compute, and the result returns to DuckDB as a table you can join with your local files.
With the extension, you get the following capabilities:
-
Query your data where it lives – Redshift reads data in Amazon S3, Amazon S3 Tables, and Amazon Redshift, and returns only the rows that answer your query, so there is no export, download, and reload.
-
Open access to Redshift Managed Storage – Data in Redshift Managed Storage is open to query from a DuckDB session. You join it with your local files and your Amazon S3 and Amazon S3 Tables data, with no export or copy.
-
Scale past one machine without migrating – Run a large query on Redshift compute from the same session, instead of standing up a separate engine and rewriting your work in another tool. With Amazon Redshift Serverless with express configuration, there's nothing to provision first, and Redshift is available to run SQL in about 2 seconds1, with no compute or networking setup.
-
Keep a single workflow – If you already use Amazon Redshift alongside DuckDB, you join warehouse tables, including Redshift Managed Storage, with local files in one statement, instead of exporting warehouse data to Amazon S3 and reloading it locally.
-
Run under your own identity – Every query runs with your AWS Identity and Access Management (IAM) credentials and your Redshift permissions.
The extension signs in with IAM credentials from a DuckDB secret, the default credential chain, or a named profile. There are no database passwords to manage. The extension includes the Amazon Redshift ODBC driver, so you don't install a driver, driver manager, or data source name (DSN).
The extension is open-source, and its source code is on GitHub. You can browse the code,
report issues, and request enhancements in the aws/duckdb-redshift
repository on GitHubLICENSE, NOTICE, and
THIRD_PARTY_LICENSES files in the repository.
The extension supports Amazon Redshift provisioned clusters, Redshift Serverless workgroups, and Amazon Redshift Serverless with express configuration.
The redshift extension opens the IAM-authenticated connection through its
included Amazon Redshift ODBC driver, runs your SQL on Redshift, and returns the results as
DuckDB tables. Each attach names one credential source: the default credential
chain, a named profile, or a DuckDB secret. Only the secret option uses the
aws extension, a DuckDB core extension that turns your AWS
credentials into a secret.
The following SQL example loads the extension, attaches a workgroup with the default credential chain, and runs one statement:
LOAD redshift FROM aws.amazon.com; ATTACH '' AS rs (TYPE redshift, WORKGROUP 'my-workgroup', ACCOUNT_ID '111122223333', REGION 'us-east-1', CREDENTIAL_PROVIDER aws_default_chain); SELECT * FROM redshift_query('rs', 'SELECT current_user');
To get started, install the extension, create a secret, attach a target, and query it. For the steps, see Installing the extension, Authentication and IAM permissions, Attaching to Amazon Redshift, and Running queries with redshift_query.
1 Median time from first request to query-ready, measured across 2,727 new express configuration instances in 32 AWS Regions in production, November 2026. Medians ranged from 1.35 to 2.13 seconds by Region.