Search Shortcut cmd + k | ctrl + k
- Documentation
- Specification
- Introduction
- Data Types
- Queries
- Tables
- Overview
- column
- column_mapping
- name_mapping
- column_tag
- data_file
- delete_file
- file_column_stats
- file_partition_value
- files_scheduled_for_deletion
- inlined_data_tables
- metadata
- partition_column
- partition_info
- schema
- schema_versions
- snapshot
- snapshot_changes
- table
- table_column_stats
- table_stats
- tag
- view
- DuckDB Extension
- Introduction
- Usage
- Connecting
- Choosing a Catalog Database
- Choosing Storage
- Snapshots
- Schema Evolution
- Time Travel
- Upserting
- Configuration
- Paths
- Maintenance
- Recommended Maintenance
- Merge Files
- Expire Snapshots
- Cleanup of Files
- Rewrite Files with Deletes
- Checkpoint
- Advanced Features
- Constraints
- Conflict Resolution
- Data Change Feed
- Data Inlining
- Encryption
- Partitioning
- Transactions
- Row Lineage
- Views
- Comments
- Metadata
- Migrations
- Guides
- Unsupported Features
- FAQ
Documentation
/ DuckDB Extension
/ Advanced Features
Constraints
DuckLake has limited support for constraints.
The only constraint type that is currently supported is NOT NULL.
It does not support PRIMARY KEY, FOREIGN KEY, UNIQUE or CHECK constraints.
Examples
Define a column as not accepting NULL values using the NOT NULL constraint.
CREATE TABLE tbl (col INTEGER NOT NULL);
Add a NOT NULL constraint to an existing column of an existing table.
ALTER TABLE tbl ALTER col SET NOT NULL;
Drop a NOT NULL constraint from a table.
ALTER TABLE tbl ALTER col DROP NOT NULL;