Docs Home
Quickstart
Learn CockroachDB SQL
Learn CockroachDB SQL
JavaScript/TypeScript
JavaScript/TypeScript
JavaScript/TypeScript
JavaScript/TypeScript
JavaScript/TypeScript
Python
Python
Python
Python
Golang
Golang
Golang
Golang
Java
Java
Java
Java
Ruby
Ruby
C# (.NET)
Rust
Hasura (GraphQL)
AWS Lambda
Google Cloud Run
Netlify
Vercel
Serverless Function Best Practices
Glossary
CockroachDB FAQs
SQL FAQs
Operational FAQs
Availability FAQs
Licensing FAQs
Enterprise Features
CockroachDB in Comparison
Developer Guide Overview
Developer Basics
Install a Driver or ORM Framework
Connect to a Cluster
Use Connection Pools
Overview
Create a Database
Create a User-defined Schema
Create a Table
Secondary Indexes
Change and Remove Objects
Online Schema Changes
Computed Columns
Group Columns into Families
Index a Subset of Rows
Index Sequential Keys
Index JSON and Array Data
Index Trigrams
Index Expressions
Index Spatial Data
Scale to Multiple Regions
Insert Data
Update Data
Bulk-update Data
Delete Data
Bulk-delete Data
Batch Delete Expired Data with Row-Level TTL
Select Rows of Data
Reusable Views
Subqueries
Temporary Tables
Paginate Results
Follower Reads
AS OF SYSTEM TIME
Query Spatial Data
Transactions Overview
Advanced Client-side Transaction Retries
Test Your Application Locally
Troubleshoot Common Problems
Overview
Statement Tuning with EXPLAIN
Apply SQL Statement Performance Rules
Map SQL Activity using an Application Name
SQL Performance Best Practices
Performance Tuning Recipes
Overview
Indexes
Cost-Based Optimizer
Vectorized Execution Engine
Load-Based Splitting
Admission Control
Overview of Example Applications
Spring Boot with JDBC
Spring Boot with JPA
Overview
Overview
Global Application Use Case
Multi-region Database Schema
Set up a Development Environment
Develop a Global Application
Deploy a Global Application
Deploy a Python To-Do App with Flask, Kubernetes, and CockroachDB Cloud
Tutorials Overview
Alembic
Flyway
Liquibase
DBeaver GUI
IntelliJ IDEA
Satori
HashiCorp Vault
SQL Playground
Create an Account
Plan a CockroachDB Serverless Cluster
Create a CockroachDB Basic Cluster
Connect to a Basic Cluster
Optimize Your CockroachDB Basic Workload
Plan a CockroachDB Standard Cluster
Create a CockroachDB Standard Cluster
Connect to a CockroachDB Standard Cluster
Move into Production
Plan a CockroachDB Advanced Cluster
Create a CockroachDB Advanced Cluster
CockroachDB Advanced on Azure
Connect to a CockroachDB Advanced Cluster
Move into Production
Install CockroachDB
Install CockroachDB
Install CockroachDB
Install CockroachDB
Start From Binary
Start From Binary
Start In Kubernetes
Start In Kubernetes
Start In Docker
Start In Docker
Start In Docker
Simulate a Multi-Region Cluster on localhost
Production Checklist
Overview
Single-Cluster Deployment
Single-Cluster Deployment
OpenShift Deployment
Multi-Cluster Deployment
Overview
On-Premises Deployment
On-Premises Deployment
Deploy on AWS
Deploy on AWS
Deploy on Azure
Deploy on Azure
Deploy on Digital Ocean
Deploy on Digital Ocean
Deploy on Google Cloud Platform GCE
Deploy on Google Cloud Platform GCE
Overview
How to Choose a Multi-Region Configuration
When to Use ZONE vs. REGION Survival Goals
When to Use REGIONAL vs. GLOBAL Tables
Data Domiciling with CockroachDB
Migrate to Multi-Region SQL
Table Partitioning
Multi-Region Zone Config Extensions
Using GeoServer with CockroachDB
Overview
Development
Basic Production
Regional Tables
Global Tables
Follower Reads
Follow-the-Workload
Replication & Rebalancing
Fault Tolerance & Recovery
Multi-Region Performance
Serializable Transactions
Spatial Data
Cross-Cloud Migration
JSON Support
Manage a CockroachDB Basic Cluster
Manage a CockroachDB Basic Cluster
Manage Billing
Use the Cloud API
Use the ccloud command
Provision a Basic cluster using Terraform
Pod Scheduling
Resource Management
Certificate Management
Cluster Scaling
Cluster Monitoring
Cluster Upgrades
Optimizing Performance
Backup and Restore Overview
Backup Architecture
Managed-Service Backups
Take and Restore Customer-Owned Backups on CockroachDB Cloud
Full and Incremental Backups
Backups with Revision History and Point-in-time Restore
Encrypted Backup and Restore
Locality-aware Backup and Restore
Scheduled Backups
Backup Validation
Backup and Restore Monitoring
Restoring Backups Across Versions
Use Cloud Storage
Cloud Storage Authentication
Userfile Storage
Local File Server
Secure CockroachDB Cloud Clusters
Create Private Clusters
Managing AWS PrivateLink for an Advanced Cluster
Overview
Manage CMEK
Authentication Overview
Single Sign-On (SSO) for CockroachDB Cloud Organizations
Configure Cloud Organization SSO
Configure SCIM provisioning
Cluster Single Sign-On (SSO) using CockroachDB Cloud Console
Certificate Authentication for SQL Clients in CockroachDB Advanced Clusters
Network Authorization
SQL Audit Logging
Export Cloud Organization Audit Logs
CockroachDB Cloud Access Management Overview and FAQ
Managing Access in CockroachDB Cloud
Use the CockroachDB CLI to provision a development cluster
Manage PKI certificates for a CockroachDB deployment with HashiCorp Vault
Create Security Certificates using OpenSSL
Using Online Certificate Status Protocol (OCSP) with CockroachDB
Authentication
Encryption
Authorization
SQL Audit Logging
GSSAPI Authentication
Cluster Single Sign-on (SSO) using JSON web tokens (JWT)
Single Sign-on (SSO) for DB Console
Rotate Security Certificates
Configure SQL Authentication for Hardened Serverless Cluster Security
Using Hashicorp Vault's Dynamic Secrets for Enhanced Database Credential Security
Cluster Overview Page
Alerts Page
Tools Page
Metrics Page
Statements Page
Sessions Page
Transactions Page
Insights Page
Databases Page
Jobs Page
Monitoring Clusters Overview
Common Issues to Monitor
Enable the Node Map
Use Prometheus and Alertmanager
Cluster API
Third-Party Monitoring Integration Overview
Export Metrics From a CockroachDB Advanced Cluster
Monitor CockroachDB self-hosted with Datadog
Monitor CockroachDB self-hosted with DBmarlin
Monitor CockroachDB self-hosted with Kibana
Overview
Configure Logs
Logging Use Cases
Export Logs From CockroachDB Advanced
Upgrade Policy
Upgrade a cluster
Upgrade to CockroachDB
Manage Long-Running Queries
Node Shutdown
Disaster Recovery
Replication Controls
Troubleshooting Overview
Common Errors and Solutions
Troubleshoot Cluster Setup
Troubleshoot Statement Behavior
Troubleshoot CockroachDB Cloud
Replication Reports
Support Resources
File an Issue
Migration Overview
Use the Schema Conversion Tool
Migrate from CSV
Migrate from Avro
Migrate from Shapefiles
Migrate from OpenStreetMap
Migrate from GeoJSON
Migrate from GeoPackage
Import Performance Best Practices
AWS DMS
Qlik Replicate
Striim
Export Spatial Data
Change Data Capture Overview
Create and Configure Changefeeds
Changefeed Messages
Changefeed Sinks
Changefeed Examples
Change Data Capture Transformations
Changefeeds on Tables with Column Families
Export Data with Changefeeds
Changefeeds in Multi-Region Deployments
Monitor and Debug Changefeeds
Stream a Changefeed from CockroachDB Cloud to Snowflake
Stream a Changefeed to a Confluent Cloud Kafka Cluster
Advanced Changefeed Configuration
Architecture Overview
SQL Layer
Transaction Layer
Distribution Layer
Replication Layer
Storage Layer
Life of a Distributed Transaction
Reads and Writes Overview
SQL Overview
PostgreSQL Compatibility
Full SQL Grammar
Keywords & Identifiers
Constants
Selection Queries
Cursors
Table Expressions
Common Table Expressions
Scalar Expressions
User-Defined Functions
NULL Handling
Overview
ALTER BACKUP (Enterprise)
ALTER BACKUP SCHEDULE
ALTER CHANGEFEED (Enterprise)
ALTER DATABASE
ALTER DEFAULT PRIVILEGES
ALTER FUNCTION
ALTER INDEX
ALTER PARTITION (Enterprise)
ALTER RANGE
ALTER ROLE
ALTER SCHEMA
ALTER SEQUENCE
ALTER TABLE
ALTER TYPE
ALTER USER
ALTER VIEW
BACKUP
BEGIN
CANCEL JOB
CANCEL QUERY
CANCEL SESSION
COMMENT ON
COMMIT
COPY FROM
CREATE CHANGEFEED (Enterprise)
CREATE DATABASE
CREATE EXTERNAL CONNECTION
CREATE FUNCTION
CREATE INDEX
CREATE ROLE
CREATE SCHEDULE FOR BACKUP
CREATE SCHEMA
CREATE SEQUENCE
CREATE STATISTICS
CREATE TABLE
CREATE TABLE AS
CREATE TYPE
CREATE USER
CREATE VIEW
DELETE
DROP DATABASE
DROP EXTERNAL CONNECTION
DROP FUNCTION
DROP OWNED BY
DROP TYPE
DROP INDEX
DROP ROLE
DROP SCHEDULES
DROP SCHEMA
DROP SEQUENCE
DROP TABLE
DROP USER
DROP VIEW
EXPERIMENTAL CHANGEFEED FOR
EXPLAIN
EXPLAIN ANALYZE
EXPORT
GRANT
IMPORT
IMPORT INTO
INSERT
JOIN
LIMIT/OFFSET
ORDER BY
PAUSE JOB
PAUSE SCHEDULES
REASSIGN OWNED
REFRESH
RELEASE SAVEPOINT
RESET CLUSTER SETTING
RESET {session variable}
RESTORE
RESUME JOB
RESUME SCHEDULES
REVOKE
ROLLBACK
SAVEPOINT
SELECT
SELECT FOR UPDATE
SET CLUSTER SETTING
SET {session variable}
SET TRANSACTION
SHOW BACKUP
SHOW CLUSTER SETTING
SHOW COLUMNS
SHOW CONSTRAINTS
SHOW CREATE
SHOW CREATE EXTERNAL CONNECTION
SHOW CREATE SCHEDULE
SHOW DATABASES
SHOW DEFAULT PRIVILEGES
SHOW ENUMS
SHOW FULL TABLE SCANS
SHOW GRANTS
SHOW INDEX
SHOW JOBS
SHOW LOCALITY
SHOW PARTITIONS (Enterprise)
SHOW RANGES
SHOW RANGE FOR ROW
SHOW REGIONS
SHOW {session variable}
SHOW SUPER REGIONS
SHOW SYSTEM GRANTS
SHOW ROLES
SHOW SCHEDULES
SHOW SCHEMAS
SHOW SEQUENCES
SHOW SESSIONS
SHOW STATEMENTS
SHOW STATISTICS
SHOW SAVEPOINT STATUS
SHOW TABLES
SHOW TRACE FOR SESSION
SHOW TRANSACTIONS
SHOW TYPES
SHOW USERS
SHOW ZONE CONFIGURATIONS
TRUNCATE
UPDATE
UPSERT
WITH {storage parameter}
Overview
ARRAY
BIT
BOOL
BYTES
COLLATE
DATE
DECIMAL
ENUM
FLOAT
INET
INT
INTERVAL
JSONB
OID
SERIAL
STRING
TIME
TIMESTAMP
UUID
Overview
Check
Default Value
Foreign Key
Not Null
Primary Key
Unique
Functions and Operators
Window Functions
Name Resolution
Overview
crdb_internal
information_schema
pg_catalog
pg_extension
Overview
Work with Spatial Data
Spatial and GIS Glossary
POINT
LINESTRING
POLYGON
MULTIPOINT
MULTILINESTRING
MULTIPOLYGON
GEOMETRYCOLLECTION
Well Known Text (WKT)
Well Known Binary (WKB)
GeoJSON
SRID 4326 - longitude and latitude
ST_Contains
ST_Within
ST_Intersects
ST_CoveredBy
ST_Covers
ST_Disjoint
ST_Equals
ST_Overlaps
ST_Touches
ST_ConvexHull
ST_Union
Cluster Settings
Security Overview
Authentication
SASL/SCRAM-SHA-256 Secure Password-based Authentication
Authorization
Encryption
Public Key Infrastructure (PKI) and Transport Layer Security (TLS)
Customer-Managed Encryption Keys (CMEK)
Payment Card Industry Data Security Standard (PCI DSS)
cockroach Commands Overview
Client Connection Parameters
cockroach start
cockroach init
cockroach start-single-node
cockroach cert
cockroach sql
cockroach sqlfmt
cockroach node
cockroach nodelocal upload
cockroach auth-session
cockroach demo
cockroach debug ballast
cockroach debug encryption-active-key
cockroach debug job-trace
cockroach debug list-files
cockroach debug merge-logs
cockroach debug tsdump
cockroach debug zip
cockroach statement-diag
cockroach gen
cockroach userfile upload
cockroach userfile list
cockroach userfile get
cockroach userfile delete
cockroach version
cockroach workload
cockroach import
The cockroach-sql command
DB Console Overview
Cluster Overview Page
Overview Dashboard
Hardware Dashboard
Runtime Dashboard
SQL Dashboard
Storage Dashboard
Replication Dashboard
Distributed Dashboard
Queues Dashboard
Slow Requests Dashboard
Changefeeds Dashboard
Overload Dashboard
TTL Dashboard
Custom Chart
Databases Page
Sessions Page
Statements Page
Transactions Page
Insights Page
Network Latency Page
Hot Ranges Page
Jobs Page
Schedules Page
Advanced Debug Page
Metrics
Transaction Retry Error Reference
Cluster API
Cloud API
Logging Levels and Channels
Log Formats
Notable Event Types
API Support Policy
Diagnostics Reporting
Overview
Benchmarking Instructions
Benchmarking Instructions
Benchmarking Instructions
Benchmarking Instructions
Benchmarking Instructions
CockroachDB Feature Availability
Tools Supported by Cockroach Labs
Tools Supported by the Community
Latest Production Release
All Releases
v25.1
v24.3
v24.2
v24.1
Release Support Policy
Known Limitations
CockroachDB Cloud
CockroachDB Kubernetes Operator
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Technical Advisories
Unsupported Versions
Online Courses