- Installation
- What's New in the Docs for 2.0
- Documentation
- Getting Started
- Connect
- Data Import and Export
- Overview
- Data Sources
- CSV Files
- IO
- JSON Files
- Overview
- Creating JSON
- Loading JSON
- Writing JSON
- JSON Type
- JSON Functions
- Format Settings
- Installing and Loading
- SQL to / from JSON
- Caveats
- Multiple Files
- Parquet Files
- Partitioning
- Appender
- INSERT Statements
- Lakehouse Formats
- Client APIs
- Overview
- ADBC
- C
- Overview
- Startup
- Configuration
- Query
- Data Chunks
- Vectors
- Values
- Types
- Prepared Statements
- Appender
- Table Functions
- Replacement Scans
- API Reference
- C++
- CLI
- Overview
- Arguments
- Dot Commands
- Output Formats
- Agent Mode
- Editing
- Friendly CLI
- Safe Mode
- Autocomplete
- Syntax Highlighting
- Known Issues
- Go
- Overview
- Connect
- Import Data
- Run Queries
- Handle Results
- Write User Defined Functions
- Profile and Monitor
- Troubleshoot
- Java (JDBC)
- Overview
- Connect
- Import Data
- Run Queries
- Handle Results
- Write User Defined Functions
- Profile and Monitor
- Deploy as Native Image
- Troubleshoot
- Node.js (Neo)
- ODBC
- Python
- Overview
- Data Ingestion
- Appender
- Conversion between DuckDB and Python
- DB API
- Relational API
- Function API
- Types API
- Expression API
- Spark API
- API Reference
- Known Python Issues
- Migrating to 2.0
- R
- Rust
- Overview
- Connect
- Import Data
- Run Queries
- Handle Results
- Write User Defined Functions
- Profile and Monitor
- Troubleshoot
- Wasm
- Tertiary Clients
- SQL
- Introduction
- Statements
- Overview
- ANALYZE
- ALTER DATABASE
- ALTER TABLE
- ALTER VIEW
- ATTACH and DETACH
- CALL
- CHECKPOINT
- COMMENT ON
- CONNECT and DISCONNECT
- COPY
- CREATE INDEX
- CREATE MACRO
- CREATE SCHEMA
- CREATE SECRET
- CREATE SEQUENCE
- CREATE TABLE
- CREATE VIEW
- CREATE TRIGGER
- CREATE TYPE
- DELETE
- DESCRIBE
- DROP
- EXPORT and IMPORT DATABASE
- INSERT
- LOAD / INSTALL
- MERGE INTO
- PIVOT
- Profiling
- PREPARE, EXECUTE, and DEALLOCATE
- SELECT
- SET / RESET
- SET VARIABLE
- SHOW and SHOW DATABASES
- SUMMARIZE
- Transaction Management
- UNPIVOT
- UPDATE
- UPDATE EXTENSIONS
- USE
- VACUUM
- Query Syntax
- SELECT
- FROM and JOIN
- WHERE
- GROUP BY
- GROUPING SETS
- HAVING
- ORDER BY
- LIMIT and OFFSET
- SAMPLE
- Unnesting
- WITH
- WINDOW
- QUALIFY
- VALUES
- FILTER
- Set Operations
- Prepared Statements
- Data Types
- Overview
- Array
- Bitstring
- Blob
- Boolean
- Date
- Enum
- Geometry
- Interval
- List
- Literal Types
- Map
- NULL Values
- Numeric
- Struct
- Text
- Time
- Timestamp
- Time Zones
- Union
- Typecasting
- Variant
- Expressions
- Overview
- CASE Expression
- Casting
- Collations
- Comparisons
- IN Operator
- Logical Operators
- Star Expression
- Subqueries
- TRY
- Functions
- Overview
- Aggregate Functions
- Array Functions
- Bitstring Functions
- Blob Functions
- Date Format Functions
- Date Functions
- Date Part Functions
- Enum Functions
- Geometry Functions
- Interval Functions
- Lambda Functions
- List Functions
- Map Functions
- Nested Functions
- Numeric Functions
- Pattern Matching
- Regular Expressions
- Struct Functions
- Text Functions
- Time Functions
- Timestamp Functions
- Timestamp with Time Zone Functions
- Union Functions
- Utility Functions
- Variant Functions
- Window Functions
- Constraints
- Indexes
- Meta Queries
- DuckDB's SQL Dialect
- Overview
- Indexing
- Friendly SQL
- Keywords and Identifiers
- Order Preservation
- PostgreSQL Compatibility
- SQL Quirks
- PEG Parser
- Samples
- Configuration
- Extensions
- Overview
- Installing Extensions
- Advanced Installation Methods
- Distributing Extensions
- Extension Repositories
- Community Extensions
- Versioning of Extensions
- Troubleshooting of Extensions
- Core Extensions
- Overview
- AutoComplete
- Avro
- AWS
- Azure
- Delta
- DuckLake
- Encodings
- Excel
- Full Text Search
- httpfs (HTTP and S3)
- Overview
- HTTP(S) Support
- Hugging Face
- S3 API Support
- S3 and AWS Authentication
- Legacy Authentication Scheme for S3 API
- Iceberg
- ICU
- inet
- Lance
- Legacy Parser
- MotherDuck
- MySQL
- ODBC
- Quack
- PostgreSQL
- Sirius
- Spatial
- SQLite
- SQLSmith
- TPC-DS
- TPC-H
- UI
- Unity Catalog
- Vortex
- VSS
- Quack Remote Protocol
- Guides
- Overview
- Data Viewers
- Database Integration
- File Formats
- Overview
- CSV Import
- CSV Export
- Directly Reading Files
- Directly Reading DuckDB Databases
- Excel Import
- Excel Export
- JSON Import
- JSON Export
- Parquet Import
- Parquet Export
- Querying Parquet Files
- File Access with the file: Protocol
- Meta Queries
- Describe Table
- EXPLAIN: Inspect Query Plans
- EXPLAIN ANALYZE: Profile Queries
- List Tables
- Summarize
- DuckDB Environment
- Network and Cloud Storage
- Overview
- HTTP Parquet Import
- HTTP CSV Import
- S3 Parquet Import
- S3 Parquet Export
- S3 Iceberg Import
- S3 Express One
- GCS Import
- Cloudflare R2 Import
- DuckDB over HTTPS / S3
- Share a Views-Only Database
- Fastly Object Storage Import
- SeaweedFS Import
- Tigris Import
- ODBC
- Performance
- Overview
- Environment
- Import
- Schema
- Indexing
- Join Operations
- File Formats
- How to Tune Workloads
- My Workload Is Slow
- Out-of-Memory Issues
- Benchmarks
- Working with Huge Databases
- Python
- Installation
- Executing SQL
- Jupyter Notebooks
- marimo Notebooks
- SQL on Pandas
- Import from Pandas
- Export to Pandas
- Import from Numpy
- Export to Numpy
- SQL on Arrow
- Import from Arrow
- Export to Arrow
- Relational API on Pandas
- Multiple Python Threads
- Integration with Ibis
- Integration with Polars
- Integration with PyTorch
- Using fsspec Filesystems
- SQL Editors
- Beekeeper Studio SQL Editor
- DBeaver SQL IDE
- DBine SQL Editor
- LibreDB Studio SQL Editor
- VisuaLeaf SQL Editor
- SQL Features
- AsOf Join
- Full-Text Search
- Graph Queries
- query and query_table Functions
- Merge Statement for SCD Type 2
- Timestamp Issues
- Snippets
- Creating Synthetic Data
- Dutch Railway Datasets
- Sharing Macros
- Analyzing a Git Repository
- Importing Duckbox Tables
- Copying an In-Memory Database to a File
- Calculating a Database Checksum
- Troubleshooting
- Glossary of Terms
- Browsing Offline
- Operations Manual
- Overview
- Migrating to DuckDB v2.0
- Backup Extension Repositories
- DuckDB's Footprint
- Installing DuckDB
- Logging
- User Agents
- Securing DuckDB
- Non-Deterministic Behavior
- Limits
- DuckDB Docker Container
- Development
- Overview
- DuckDB Repositories
- Release Cycle
- Metrics
- Profiling
- Building DuckDB
- Overview
- Build Configuration
- Building Extensions
- Statically Linking Extensions
- Android
- Linux
- macOS
- Raspberry Pi
- Windows
- Python
- R
- Troubleshooting
- Unofficial and Unsupported Platforms
- Benchmark Suite
- Testing
- Overview
- sqllogictest Introduction
- Writing Tests
- Unit Tester Configuration
- Debugging
- Result Verification
- Persistent Testing
- Loops
- Multiple Connections
- Catch
- Internal Errors
- Internals
- Sitemap
- Live Demo
DuckDB 2.0.0 is packed with new features and performance improvements, including query optimization and asynchronous I/O. It also ships a small set of breaking changes, most notably a new default storage format, which DuckDB versions before 2.0.0 cannot read, and the next step of the lambda syntax transition. This page provides guidance on migrating existing deployments to DuckDB 2.0.0.
Before You Migrate
Before migrating to DuckDB 2.0.0, assess whether your workload is mission-critical. For such workloads, consider waiting for upcoming patch releases, which address issues that surface shortly after a major release. To help facilitate this, the DuckDB development team extended support for DuckDB 1.5 until March 2027. Note that DuckDB 1.4 LTS reaches its end of life on November 17, 2026.
Bestpractice In all cases, we recommend setting up a shadow system that tracks your existing workload. This lets you test DuckDB 2.0.0 in an environment outside of your production system before switching over.
For simple deployments, migrating is straightforward. Complex deployments, especially those that run many DuckDB processes, require more care. We expect the most common source of issues to be the storage format, which is described first below.
Breaking Changes
Storage Format
DuckDB versions before 2.0.0 cannot read database files that use the DuckDB 2.0.0 storage format. By default, every new database file created by v2.0.0 uses this format (storage version 69).
The other direction keeps working: DuckDB 2.0.0 can read and write existing database files created by earlier versions. These files keep their storage version when v2.0.0 writes to them, so they remain readable by the earlier version.
For example, creating a database with v2.0.0 and then opening it with v1.5.6 results in an error:
~/.duckdb/cli/latest/duckdb my.db -c "CREATE TABLE t (x INT);"
~/.duckdb/cli/1.5.6/duckdb my.db
IO Error: Trying to read a database file with version number 69, but we can only read versions between 64 and 68.
The database file was created with a newer version of DuckDB.
Newer DuckDB version might introduce backward incompatible changes (possibly guarded by compatibility settings).
See the storage page for migration strategy and more information: https://duckdb.org/internals/storage
Warning In a deployment with many DuckDB processes running different versions, a database file created by a v2.0.0 process is unreadable by the remaining older processes. Roll out the upgrade carefully and verify that every process that touches a shared database file is on a compatible version.
Writing Files for Older Versions
If you need database files that remain readable by an older DuckDB version, write them with an explicit storage version using the -storage-version command line argument:
~/.duckdb/cli/latest/duckdb my.db -storage-version v1.5.6 -c "CREATE TABLE t (x INT);"
~/.duckdb/cli/1.5.6/duckdb my.db
The storage version can also be set with the storage_compatibility_version configuration option or the STORAGE_VERSION option of the ATTACH statement.
For the full set of methods and the mapping between DuckDB versions and storage versions, see the Storage Versions and Format page.
Converting Existing Databases
To move an existing database file to the v2.0.0 storage format, open it with the older DuckDB version and export it, then import it with v2.0.0:
/older/duckdb mydata.old.db -c "EXPORT DATABASE 'tmp'"
/newer/duckdb mydata.new.db -c "IMPORT DATABASE 'tmp'"
For details on this and other conversion methods, including COPY FROM DATABASE, see How to Move between Storage Formats.
Lambda Syntax
DuckDB 2.0.0 takes the next step in the lambda syntax transition that began in v1.3.
The old single arrow syntax (x -> x + 1) is now disabled by default in favor of the Python-style syntax (lambda x : x + 1).
-- disabled by default in v2.0.0
SELECT list_transform([1, 2, 3], x -> x + 1);
-- use the Python-style syntax instead
SELECT list_transform([1, 2, 3], lambda x : x + 1);
If you cannot update your queries yet, you can re-enable the old syntax for the session:
SET lambda_syntax = 'enable_single_arrow';
This flag is a temporary bridge: DuckDB 2.1 will remove it and the single arrow syntax entirely. For details, see Deprecated Syntax.
SQL Parser
DuckDB 2.0.0 replaced the PostgreSQL-derived parser with a new PEG-based parser. It is designed to be compatible with the previous parser, so queries that parsed before should continue to parse, and error messages now include more precise source locations. If a query that parsed on an earlier version fails on v2.0.0, please file an issue. For details, see the PEG parser page.
If you would like to revert to the old parser, use the legacy_parser extension.
To install and activate it, run the following commands:
INSTALL AND LOAD legacy_parser;
SET enable_legacy_parser = true;
C API v2
DuckDB 2.0.0 ships a revamped C API, which is considerably more powerful than its predecessor and exposes components such as file systems and table functions to extensions. The C API v2 is not yet stable: its interface may change in upcoming releases. For background on extension stability levels, see Versioning of Extensions; for the C API reference, see the C API page.
ICU Removed from the Core Build
DuckDB 2.0.0 removed the dependency on the ICU library.
Time zones, calendars and collations are now implemented natively by the icu extension, and will continue to behave as before.
No query changes are required, but if you ship a custom build, note that ICU is no longer bundled.
If you find that ICU's behavior changed, please file an issue.
Division by Zero
Integer division (//) and modulo (%) by zero, e.g., 1 // 0 and 1 % 0, now throw an error instead of returning NULL:
Invalid Input Error: Division by zero in expression (1 // 0). Use TRY(...) to return NULL for this expression, or SET error_on_division_by_zero=false to return NULL for all divisions by zero.
To get NULL for a single expression, wrap it in TRY, e.g., TRY(1 // 0).
Regular division (1 / 0) still returns inf.
Identifier Case Setting
The preserve_identifier_case setting changed from a BOOLEAN to a VARCHAR with the values 'preserve_case' (default), 'lowercase' and 'uppercase'.
The old values true and false are still accepted and map to 'preserve_case' and 'lowercase', respectively.
S3 URL Parameters
Passing S3 settings as URL parameters (e.g., s3://bucket/file.csv?s3_access_key_id=...) is disabled by default: the ? and the following text are now treated as part of the object key.
Use secrets instead or, if you need the legacy behavior, opt in with SET s3_enable_deprecated_url_parameters = true (available after loading the httpfs extension).
Removed and Deprecated Settings
- The
custom_profiling_settingssetting was removed. Usetracked_metricsinstead, see Profiling. - The
enable_http_loggingandhttp_logging_outputsettings were removed. UseCALL enable_logging('HTTP')instead, see Logging. - The
profiling_modesetting is deprecated and its value has no effect: detailed profiling information is always collected. UsePRAGMA enable_profilingto enable profiling.
Log Storage in the CLI
Since v1.5.0, the CLI uses the shell_log_storage log storage by default, which prints warnings to the console but cannot be queried.
To query logs via duckdb_logs in the CLI, enable logging with CALL enable_logging(storage = 'memory'). Clients other than the CLI still default to the memory log storage.
What's New in v2.0
Beyond the breaking changes above, DuckDB 2.0.0 added a large set of new features. Rather than repeat the feature documentation here, this section points to where each new feature is covered in full. For the complete tour, see the preview announcement and the detailed release announcement. The What's New in the Docs for 2.0 page links every high-level new feature to its documentation, organized by theme:
- DuckDB as a server with the
quackextension and theCONNECTstatement - The
VARIANTtype for semi-structured data - Triggers that run actions automatically in response to table changes
- SQL dialect additions, including data-modifying CTEs and nested schemas
- Asynchronous I/O for faster reads from object storage
- Optimizer and engine improvements that speed up existing queries, including on Windows
- Self-hostable extension repositories for signing and distributing your own extensions
Several of the headline v2.0.0 changes are covered in Breaking Changes above: the new default storage format, the PEG-based SQL parser, the revamped C API v2 and the native timezone, calendar and collation support left after ICU was removed from the core build.