Skip to main content
Version: 0.4 (Latest)

PostgreSQL

This page covers PostgreSQL as a source database, the database LakeXpress exports data from. To use PostgreSQL as the LakeXpress DB, see PostgreSQL as LakeXpress DB.

Connection Parameters​

ParameterRequiredDescription
ds_typeYesMust be "postgres"
auth_modeYes"classic" (username/password) or "connection_string" (supply a full connection string)
usernameClassic onlyPostgreSQL username
passwordClassic onlyPostgreSQL password
serverClassic onlyHostname or IP
portNoPort (default: 5432)
databaseClassic onlyDatabase name
sslmodeNoPostgreSQL SSL mode, e.g. disable, prefer, require, verify-full (default: prefer)

With auth_mode: "connection_string", only the connection_string field is used; username, password, server, port, database, and sslmode are ignored.

Required Permissions​

LakeXpress only needs read access to the schemas it exports:

GRANT USAGE ON SCHEMA public TO lakexpress_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO lakexpress_user;

information_schema access is granted by default.

Example: Source Database​

{
"source_postgres": {
"ds_type": "postgres",
"auth_mode": "classic",
"info": {
"username": "$env{LX_PG_USER}",
"password": "$env{LX_PG_PASSWORD}",
"server": "pg-prod.company.com",
"port": 5432,
"database": "analytics"
}
}
}

Example: Connection String Mode​

{
"postgres_cs": {
"ds_type": "postgres",
"auth_mode": "connection_string",
"info": {
"connection_string": "host=pg-prod.company.com port=5432 dbname=analytics user=$env{LX_PG_USER} password=$env{LX_PG_PASSWORD} sslmode=require"
}
}
}

Troubleshooting​

Connection refused: Check PostgreSQL is running (systemctl status postgresql), verify pg_hba.conf allows your IP, check firewall (sudo ufw allow 5432/tcp).

Authentication failed: Verify credentials, check password encryption in pg_hba.conf, confirm user exists: SELECT * FROM pg_user WHERE usename='your_user';

See Also​

Copyright © 2026 Architecture & Performance.