Deploy PostgreSQL with pg_duckdb
PostgreSQL 17 with pg_duck extension.
railway-pgduckdb
joeychilson/railway-pgduckdb:sha-aa78682
Just deployed
/var/lib/postgresql/data
Deploy and Host PostgreSQL with pg_duckdb on Railway
PostgreSQL with pg_duckdb combines PostgreSQL's reliability with DuckDB's analytical power, enabling fast OLAP queries directly within Postgres. Query Parquet files, S3 data, and MotherDuck datasets without ETL pipelines.
About Hosting PostgreSQL with pg_duckdb
pg_duckdb is a PostgreSQL extension that embeds DuckDB's analytical engine, allowing you to run lightning-fast analytical queries on data lakes while maintaining PostgreSQL's transactional capabilities. It supports querying remote data sources like S3, Parquet files, and MotherDuck without moving data. This template comes pre-configured with support for S3 credentials, MotherDuck integration, and custom DuckDB extensions. Perfect for real-time analytics, data lake queries, and hybrid transactional-analytical workloads without managing separate infrastructure.
Common Use Cases
- Analytics on S3 data lakes - Query Parquet, CSV, and JSON files stored in S3 directly from PostgreSQL
- Real-time dashboards and reporting - Combine transactional PostgreSQL data with analytical DuckDB queries
- MotherDuck integration - Connect to MotherDuck for serverless analytics with persistent storage
- Data lake querying - Access remote datasets without ETL pipelines or data movement
- Hybrid OLTP/OLAP workloads - Run transactional and analytical queries in a single database
Dependencies for PostgreSQL with pg_duckdb Hosting
- PostgreSQL 17
- pg_duckdb extension v1.0.0
Deployment Dependencies
Implementation Details
Environment Variables:
Configure your deployment with these optional environment variables:
# S3 Configuration (optional)
S3_ACCESS_KEY_ID=your_access_key
S3_SECRET_ACCESS_KEY=your_secret_key
S3_REGION=us-east-1
S3_SESSION_TOKEN=optional_session_token
S3_ENDPOINT=optional_custom_endpoint
S3_URL_STYLE=path_or_virtual_hosted
# DuckDB Extensions (optional, comma-separated)
DUCKDB_EXTENSIONS=azure,iceberg,delta
Example Usage:
-- Query Parquet files from S3
SELECT * FROM read_parquet('s3://bucket/data/*.parquet');
-- Query remote CSV files
SELECT * FROM read_csv('https://example.com/data.csv');
-- Use MotherDuck
SELECT * FROM motherduck.my_database.my_table;
Why Deploy PostgreSQL with pg_duckdb on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying PostgreSQL with pg_duckdb on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
railway-pgduckdb
ghcr.io/joeychilson/railway-pgduckdb:sha-aa78682