BingsanBingsan
Configuration

Database Configuration

Configure PostgreSQL connection for metadata storage

Database Configuration

Configure the PostgreSQL connection for metadata storage.

Options

database:
  host: localhost
  port: 5432
  user: iceberg
  password: iceberg
  database: iceberg_catalog
  ssl_mode: disable
  max_open_conns: 25
  max_idle_conns: 5
  conn_max_lifetime: 5m
  conn_max_idle_time: 5m

Reference

OptionTypeDefaultDescription
hoststringlocalhostPostgreSQL server hostname
portinteger5432PostgreSQL server port
userstringicebergDatabase user
passwordstringicebergDatabase password
databasestringiceberg_catalogDatabase name
ssl_modestringdisableSSL mode (disable, require, verify-ca, verify-full)
max_open_connsinteger25Maximum open connections
max_idle_connsinteger5Maximum idle connections
conn_max_lifetimeduration5mMaximum connection lifetime
conn_max_idle_timeduration5mMaximum connection idle time

Environment Variables

ICEBERG_DATABASE_HOST=localhost
ICEBERG_DATABASE_PORT=5432
ICEBERG_DATABASE_USER=iceberg
ICEBERG_DATABASE_PASSWORD=iceberg
ICEBERG_DATABASE_DATABASE=iceberg_catalog
ICEBERG_DATABASE_SSL_MODE=disable
ICEBERG_DATABASE_MAX_OPEN_CONNS=25

SSL Modes

ModeDescription
disableNo SSL (development only)
requireUse SSL but don't verify certificate
verify-caVerify server certificate against CA
verify-fullVerify certificate and hostname

Production SSL Configuration

database:
  host: postgres.example.com
  ssl_mode: verify-full

Connection Pool Tuning

Default Settings

Suitable for most workloads:

database:
  max_open_conns: 25
  max_idle_conns: 5
  conn_max_lifetime: 5m
  conn_max_idle_time: 5m

High-Throughput Settings

For high request rates:

database:
  max_open_conns: 100
  max_idle_conns: 25
  conn_max_lifetime: 30m
  conn_max_idle_time: 10m

Database Setup

Create Database

CREATE DATABASE iceberg_catalog;
CREATE USER iceberg WITH PASSWORD 'your-secure-password';
GRANT ALL PRIVILEGES ON DATABASE iceberg_catalog TO iceberg;

Migrations

Bingsan automatically runs database migrations on startup. No manual schema setup is required.

Troubleshooting

Connection Refused

  • Verify PostgreSQL is running
  • Check host and port settings
  • Ensure network connectivity

Authentication Failed

  • Verify user and password
  • Check PostgreSQL's pg_hba.conf for allowed connections

Too Many Connections

  • Reduce max_open_conns
  • Increase PostgreSQL's max_connections

On this page