Meridian PostgreSQL/PostGIS Adapter
meridian-storage-postgresql is the Meridian V1 adapter for PostgreSQL and
PostGIS. It implements the released Core Adapter SPI and Query translation
contract while keeping SQL, topology, credentials, connection pools, and
PostgreSQL-specific settings behind the adapter boundary.
The V1 package provides:
- relational, JSON document, authoritative key/value, and evidence-table storage using one physical table per logical Resource;
- tenant and scope injection into every read, write, primary key, and applicable index;
- conditional mutations, atomic claims with
FOR UPDATE SKIP LOCKED, and one PostgreSQLREAD COMMITTEDtransaction per Meridian transaction; - joins, aggregates, signed live-keyset pagination, and WGS84 distance filters evaluated by PostGIS geography in meters;
- bounded recursive relation traversal over the Registry-resolved Relation Collection set—never database metadata or a universal edge table;
- deterministic migration plans, advisory locking, logical export/import, authenticated health probes, and read-only physical-fingerprint checks;
- local single-primary and primary-plus-two-standby conformance profiles.
Installation
python -m pip install meridian-storage-postgresql
Core discovers the adapter through the meridian_storage.adapters entry-point
group under the stable id postgresql. Application code continues to use
mapping-first Expressions and serialized Operations; it does not import the
adapter, psycopg, or SQL builders.
Binding settings
Platform/Vangu IaC renders meridian.postgresql.settings.v1 into a Meridian
Binding. A condensed example is shown below; fingerprints must be canonical
sha256: values and real deployments pin every declared Resource.
{
"formatVersion": "meridian.postgresql.settings.v1",
"scopeKeys": ["workspace"],
"topology": {"expectedStandbys": 0},
"resources": [
{
"ref": "structured:example.people",
"table": "people",
"profile": "relational",
"schemaFingerprint": "sha256:<64 lowercase hex characters>",
"resourceFingerprint": "sha256:<64 lowercase hex characters>",
"fields": [
{
"name": "id",
"column": "id",
"logicalType": "uuid",
"cardinality": "one",
"nullable": false,
"mutable": false
}
],
"identity": ["id"],
"indexes": [],
"relation": null
}
]
}
The default profile is postgresql-postgis-local-single-primary with zero
standbys. The cluster profile is postgresql-postgis-cluster and requires at
least two streaming standbys. The adapter validates those properties; it does
not provision, promote, fail over, back up, or restore instances.
Migrations and recovery boundary
Startup opens the pool and performs authenticated/read-only verification only.
It never acquires a migration lock and never executes DDL. Platform migration
jobs explicitly invoke SchemaCompiler and MigrationExecutor; the executor
uses a transaction-scoped advisory lock, compares the expected physical
fingerprint, and records a distinct deterministic plan fingerprint before
applying DDL. V1 supports initial creation and compatible additive nullable
columns. Destructive or otherwise incompatible evolution fails closed for a
new design and migration job rather than being inferred by the adapter.
LogicalTransfer provides bounded logical JSON-lines export/import. Physical
backup status, backup creation, restore, promotion, identities, ACLs, and
lifecycle remain Platform IaC authority. RecoveryHook describes that handoff
and intentionally has no administrative side effects.
The package also exposes a released SemanticsAdapter facade for schema
validation, activation planning/apply, Registry revision access, canonical
encoding/decoding, and logical transfer. It does not add public engine concepts
or bypass the Core SPI.
Development
uv sync --extra test
uv run ruff check .
uv run mypy
uv run pytest
uv build
uv run twine check dist/*
Genuine integration tests cover postgis/postgis:16-3.4-alpine and
postgis/postgis:17-3.5-alpine; they are skipped unless
MERIDIAN_POSTGRESQL_TEST_DSN is set. See
docs/conformance.md for exact commands and evidence.
Compatibility
V1 pins meridian-storage-core, meridian-storage-semantics, and
meridian-storage-query to 1.0.0. The locked design revisions and supported
PostgreSQL/PostGIS profiles are recorded in the wheel's compatibility.json.
Native PostgreSQL queries are intentionally excluded from V1.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meridian_storage_postgresql-1.0.0.tar.gz.
File metadata
- Download URL: meridian_storage_postgresql-1.0.0.tar.gz
- Upload date:
- Size: 128.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b32ad5da7b2c18aeeb2721739548cfe164f4a139cdd8553472d8d920a296de7
|
|
| MD5 |
7b2d53679eb8b8dfaa83a4af95359e6f
|
|
| BLAKE2b-256 |
0a81d945567effc9cbc0431d6c19da78d926606abaf103bf07e01031c399793e
|
Provenance
The following attestation bundles were made for meridian_storage_postgresql-1.0.0.tar.gz:
Publisher:
release.yml on zephytiju/meridian-storage-postgresql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_storage_postgresql-1.0.0.tar.gz -
Subject digest:
1b32ad5da7b2c18aeeb2721739548cfe164f4a139cdd8553472d8d920a296de7 - Sigstore transparency entry: 2599579262
- Sigstore integration time:
-
Permalink:
zephytiju/meridian-storage-postgresql@c13087d3bc6663c19b73775b765674e1e1575be1 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/zephytiju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c13087d3bc6663c19b73775b765674e1e1575be1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file meridian_storage_postgresql-1.0.0-py3-none-any.whl.
File metadata
- Download URL: meridian_storage_postgresql-1.0.0-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63fe642ea3d20585186eac0e35d8408ca529343a688290308ff34581b073e322
|
|
| MD5 |
59e0c1972617149fe826af9d62a42aee
|
|
| BLAKE2b-256 |
3635868e1a280cda5abaefd9cbb4ddfe4d98e146301a4bc0b1819634c6c430d6
|
Provenance
The following attestation bundles were made for meridian_storage_postgresql-1.0.0-py3-none-any.whl:
Publisher:
release.yml on zephytiju/meridian-storage-postgresql
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meridian_storage_postgresql-1.0.0-py3-none-any.whl -
Subject digest:
63fe642ea3d20585186eac0e35d8408ca529343a688290308ff34581b073e322 - Sigstore transparency entry: 2599581794
- Sigstore integration time:
-
Permalink:
zephytiju/meridian-storage-postgresql@c13087d3bc6663c19b73775b765674e1e1575be1 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/zephytiju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c13087d3bc6663c19b73775b765674e1e1575be1 -
Trigger Event:
release
-
Statement type: