Protocol compatibility
QuestDB supports PostgreSQL wire protocol connections on port 8812 by default. The implementation is compatible with PostgreSQL 11.3 wire protocol specification.Supported features
- Simple Query protocol: Execute queries directly using the simple query flow
- Extended Query protocol: Prepare statements with parameter binding for better performance
- Named statements and portals: Create and reuse prepared statements across multiple executions
- Binary and text format: Support for both text and binary parameter/result encoding
- Authentication: Username and password authentication with configurable users
- TLS/SSL encryption: Secure connections using TLS
- Transaction support: BEGIN, COMMIT, and ROLLBACK statements
- Query caching: Automatic caching of SELECT and INSERT queries for improved performance
Server version
QuestDB reports itself as PostgreSQL version 11.3 to maintain compatibility with client drivers that perform version checks.Default configuration
| Parameter | Default Value | Description |
|---|---|---|
| Port | 8812 | PostgreSQL wire protocol listening port |
| Bind address | 0.0.0.0:8812 | Network interface and port |
| Username | admin | Default admin username |
| Password | quest | Default admin password |
| Read-only user | user | Optional read-only username |
| Read-only password | quest | Optional read-only password |
| Connection limit | 64 | Maximum concurrent connections |
| Connection timeout | 300000ms | Idle connection timeout |
| Receive buffer | 1MB | Socket receive buffer size |
| Send buffer | 1MB | Socket send buffer size |
Authentication
QuestDB supports two user types for PostgreSQL wire protocol:- Admin user (default:
admin/quest): Full read and write access - Read-only user (default:
user/quest): Query-only access, data mutation queries are rejected
server.conf
Query caching
QuestDB implements intelligent query caching for PostgreSQL protocol queries:- SELECT cache: Enabled by default, caches compiled query plans for SELECT statements
- INSERT cache: Enabled by default, caches compiled INSERT statements per session
server.conf
Configuration options
Enable or disable the PostgreSQL wire protocol inserver.conf:
server.conf
Limitations
While QuestDB implements the PostgreSQL wire protocol, it is not a full PostgreSQL database. Some limitations include:- SQL dialect differences: QuestDB uses its own SQL dialect optimized for time-series data
- System tables: PostgreSQL system catalogs are partially implemented for compatibility
- BLOB size limit: Maximum BLOB size on query is 512KB by default (configurable via
pg.max.blob.size.on.query) - Unsupported statements: Some PostgreSQL-specific statements are not supported
- DELETE statement: QuestDB does not support DELETE; use
ALTER TABLE DROP PARTITIONinstead
Performance considerations
- Use prepared statements with parameter binding for repeated queries
- Enable query caching (enabled by default) for better performance
- Increase
pg.pipeline.capacityif using large batch inserts (>64 rows) - Configure
pg.worker.countbased on available CPU cores - Use binary format for parameters when possible to reduce serialization overhead
Next steps
Connection
Learn how to connect using various PostgreSQL drivers
Queries
Execute queries via the PostgreSQL protocol