PostgreSQL
official ● signeddoze/postgres A real PostgreSQL server per instance — no Docker. Declare roles, schemas, extensions and grants in HCL and doze converges them: creating what's new, updating what changed, dropping what you removed. Boots on first connect, reaps when idle.
Usage
Drop it in doze.hcl and run doze up.
postgres "app" {
version = 18
port = 5432
owner = "app"
encoding = "UTF8"
locale = "en_US.UTF-8"
connection_limit = 50
comment = "primary app database"
shared_buffers = "256MB"
max_connections = 100
settings = {
log_min_duration_statement = "200ms"
}
role "app" {
password = "app"
login = true
createdb = true
connection_limit = 20
member_of = ["readers"]
}
role "readers" {
login = false
}
schema "analytics" {
owner = "app"
}
extension "pg_trgm" {}
grant {
role = "app"
privileges = ["ALL"]
schema = "analytics"
objects = "tables"
}
} Versions you can run
The version = you write is the engine's own version — the only version that's yours. Declare a series and doze pins its newest published build, or declare an exact build; either way it's fetched, verified, and pinned in doze.lock, so it never moves on its own.
| version = | pins (today) | exact builds |
|---|---|---|
| 14 | 14.23.0 | 24 |
| 15 | 15.18.0 | 19 |
| 16 | 16.14.0 | 15 |
| 17 | 17.10.0 | 11 |
| 18 | 18.4.0 | 5 |
every exact build, per series
Configuration
Arguments and nested blocks the engine accepts — generated from the module itself, so it can't drift.
| Name | Type | Default | Description |
|---|---|---|---|
| version REQ | number | — | Engine major to run — 14, 15, 16, 17 or 18. |
| owner | string | — | Owner role for the instance's default database. |
| encoding | string | UTF8 | Character-set encoding for the database. |
| locale | string | — | Locale (LC_COLLATE + LC_CTYPE) for the database. |
| lc_collate | string | — | Collation order, overriding locale. |
| lc_ctype | string | — | Character classification, overriding locale. |
| template | string | — | Template database to create from. |
| connection_limit | number | -1 | Max concurrent connections to the database. |
| is_template | bool | false | Mark the database as a template. |
| allow_connections | bool | true | Whether the database accepts connections. |
| tablespace | string | — | Tablespace the database lives in. |
| comment | string | — | COMMENT applied to the database. |
| shared_buffers | string | 16MB | shared_buffers server setting, e.g. "256MB". |
| max_connections | number | 50 | max_connections server setting. |
| fsync | bool | false | fsync server setting (off for the dev tuning profile). |
| autovacuum | bool | true | autovacuum server setting. |
| extensions | list(string) | — | Shorthand list of extensions to CREATE (or use extension blocks). |
| settings | map(string) | — | Arbitrary postgresql.conf settings, applied verbatim. |
role"<name>" { }
nested block · repeatableA login role / user, converged on the server.
| Name | Type | Default | Description |
|---|---|---|---|
| password | string | — | Login password. |
| login | bool | true | Whether the role may log in. |
| superuser | bool | false | Grant SUPERUSER. |
| createdb | bool | false | Allow creating databases. |
| createrole | bool | false | Allow creating other roles. |
| replication | bool | false | Allow streaming replication. |
| inherit | bool | true | Inherit privileges of member-of roles. |
| bypassrls | bool | false | Bypass row-level security. |
| connection_limit | number | -1 | Per-role connection cap. |
| valid_until | string | — | Password expiry timestamp. |
| member_of | list(string) | — | Roles this role is granted membership in. |
| comment | string | — | COMMENT applied to the role. |
| config | map(string) | — | Per-role ALTER ROLE … SET settings. |
schema"<name>" { }
nested block · repeatableA schema within the database.
| Name | Type | Default | Description |
|---|---|---|---|
| owner | string | — | Role that owns the schema. |
extension"<name>" { }
nested block · repeatableA Postgres extension to install (pgvector, postgis, …).
| Name | Type | Default | Description |
|---|---|---|---|
| version | string | — | Specific extension version. |
| schema | string | — | Schema to install the extension into. |
| source | string | — | Path to a local extension bundle to install from. |
| optional | bool | false | Skip (don't fail) if the extension is unavailable. |
| cascade | bool | false | CREATE EXTENSION … CASCADE for dependencies. |
grant"<role>" { }
nested block · repeatableA privilege grant to a role.
| Name | Type | Default | Description |
|---|---|---|---|
| privileges REQ | list(string) | — | Privileges to grant (SELECT, INSERT, ALL, …). |
| database | string | — | Target database. |
| schema | string | — | Target schema. |
| objects | string | — | Object class the grant applies to (tables, sequences, …). |
| with_grant_option | bool | false | Allow the grantee to re-grant. |
Under the hood — module releases you never write these; doze picks and pins automatically
The plugin releases that provide this engine. doze selects the newest one compatible with your doze and your declared versions, pins it in doze.lock, and the index is cumulative — older releases stay resolvable for pinned lockfiles. modules { postgres { version = "…" } } pins one exactly (the escape hatch for bisecting a regression).
| release | protocol | engine support | platforms |
|---|---|---|---|
| 0.2.3 stable | 1 | 14 · 15 · 16 · 17 · 18 | 3 platforms |
| 0.2.2 | 1 | 14 · 15 · 16 · 17 · 18 | 3 platforms |
| 0.2.1 | 1 | 14 · 15 · 16 · 17 · 18 | 3 platforms |
raw signed data: index.yaml ↗ · meta.yaml ↗