Skip to content

Tags: styk-tv/pgRDF

Tags

v0.6.25

Toggle v0.6.25's commit message
v0.6.25 — dictionary cache correctness, build identity, partition ACLs

Two independent defects behind one symptom — a term cached under one identity
being returned under another — plus the build identity needed to tell which
binary is answering, and a partition-permission fix that unblocks downstream
extensions composing over pgRDF graphs.

FIXED

* Shared-memory dictionary cache survived an extension lifetime (#88, #89).
  CREATE EXTENSION now bumps the cache generation, so a fresh install cannot
  read slots warmed before it.

* The cache was not scoped by database (#90, #91). The fingerprint hashed
  term_type, lexical value, datatype and language only, while the cache lives
  in postmaster shared memory and _pgrdf_dictionary is per-database. The same
  term in two databases shared one slot, and database B read database A's
  dict_id — writing quads referencing ids it did not own. The database OID now
  seeds both halves of the key. This needed no DROP EXTENSION: two databases on
  one instance were sufficient, and the generation counter never covered it.

* Per-graph partitions were unreadable by downstream definer rings (#96).
  PostgreSQL does not propagate ACLs to partitions, so a SECURITY DEFINER
  function owned by a non-superuser role could read pgrdf._pgrdf_quads and fail
  on the partition holding the rows. Partitions now inherit the parent's ACL at
  creation; the upgrade script backfills partitions created before this release.

ADDED

* pgrdf.build_id() (#92, #93) reports WHICH build of a version is loaded, from
  git describe --tags --always --dirty. version() reports the release line and
  is identical across every build of it, so after replacing a library it cannot
  say whether the binary now serving queries is the one installed. Deliberately
  narrow: tag, commits-since, short commit, dirty marker — no filesystem paths,
  host names or build users.

CHANGED

* module_pathname is now a bare name. PostgreSQL resolves a module_pathname
  containing a separator directly against pkglibdir and never consults
  dynamic_library_path, which made a library placed in an override directory
  unreachable regardless of path order, with no error raised. Backward
  compatible — the default dynamic_library_path is $libdir.

* pgrx =0.19.1 -> =0.19.2 (#70).

UPGRADING

  ALTER EXTENSION pgrdf UPDATE;
  SELECT pgrdf.version(), pgrdf.build_id();

sql/pgrdf--0.6.22--0.6.25.sql ships with the release. A fresh database needs
nothing beyond CREATE EXTENSION pgrdf.

Two operational notes for anyone granting on pgrdf._pgrdf_quads: grant BEFORE
creating graphs (granting afterwards covers only graphs that already exist),
and grant in its OWN transaction — GRANT locks the parent while partition
creation takes the DDL gate then the parent's AccessExclusiveLock, so doing
both in one transaction can deadlock against a concurrent add_graph.

VERSION NOTE

0.6.23 and 0.6.24 are both skipped and will never be tagged.

0.6.23 was already allocated to a planned type-closure release (now v0.6.26)
before this work needed a version. v0.6.24 was tagged and REFUSED by
release.yml's pre-build gate: META.json still read 0.6.22 while the tag said
0.6.24, so nothing was built, published or attested and LATEST.md correctly
stayed at v0.6.22. META.json is a documented member of the Rule 7 source set
(PROVENANCE.md, "Cutting a release" step 2); the cut swept for version strings
by file glob instead of following the protocol, and META.json is the one a
glob over *.toml/*.control/*.yml does not reach.

Versions are not reused here. A missing number is cleaner to explain than two
tags on different commits, and a gate that refuses is the reason this cost a
number instead of shipping a mislabelled artifact.

UPGRADE PATHS

Both shipped scripts land a COMPLETE 0.6.25:

  sql/pgrdf--0.6.22--0.6.25.sql
  sql/pgrdf--0.5.1--0.6.25.sql   (carries the 0.6.22->0.6.25 delta too)

The 0.5.1 bridge is a DIRECT path and postgres takes the shortest update
route, so an install on 0.5.1 never reads the 0.6.22 script. Renaming the
bridge without replaying the delta would land it labelled 0.6.25 with no
build_id() and no partition ACL backfill.

VERIFIED

  cargo fmt --check                                     clean
  cargo clippy --no-default-features --features pg18    -D warnings, clean
  cargo pgrx test --features pg18 pg18                  348 passed, 0 failed
  regression                                            green

v0.6.24

Toggle v0.6.24's commit message
v0.6.24 — dictionary cache correctness, build identity, partition ACLs

Two independent defects behind one symptom — a term cached under one identity
being returned under another — plus the build identity needed to tell which
binary is answering, and a partition-permission fix that unblocks downstream
extensions composing over pgRDF graphs.

FIXED

* Shared-memory dictionary cache survived an extension lifetime (#88, #89).
  CREATE EXTENSION now bumps the cache generation, so a fresh install cannot
  read slots warmed before it.

* The cache was not scoped by database (#90, #91). The fingerprint hashed
  term_type, lexical value, datatype and language only, while the cache lives
  in postmaster shared memory and _pgrdf_dictionary is per-database. The same
  term in two databases shared one slot, and database B read database A's
  dict_id — writing quads referencing ids it did not own. The database OID now
  seeds both halves of the key. This needed no DROP EXTENSION: two databases on
  one instance were sufficient, and the generation counter never covered it.

* Per-graph partitions were unreadable by downstream definer rings (#96).
  PostgreSQL does not propagate ACLs to partitions, so a SECURITY DEFINER
  function owned by a non-superuser role could read pgrdf._pgrdf_quads and fail
  on the partition holding the rows. Partitions now inherit the parent's ACL at
  creation; the upgrade script backfills partitions created before this release.

ADDED

* pgrdf.build_id() (#92, #93) reports WHICH build of a version is loaded, from
  git describe --tags --always --dirty. version() reports the release line and
  is identical across every build of it, so after replacing a library it cannot
  say whether the binary now serving queries is the one installed. Deliberately
  narrow: tag, commits-since, short commit, dirty marker — no filesystem paths,
  host names or build users.

CHANGED

* module_pathname is now a bare name. PostgreSQL resolves a module_pathname
  containing a separator directly against pkglibdir and never consults
  dynamic_library_path, which made a library placed in an override directory
  unreachable regardless of path order, with no error raised. Backward
  compatible — the default dynamic_library_path is $libdir.

* pgrx =0.19.1 -> =0.19.2 (#70).

UPGRADING

  ALTER EXTENSION pgrdf UPDATE;
  SELECT pgrdf.version(), pgrdf.build_id();

sql/pgrdf--0.6.22--0.6.24.sql ships with the release. A fresh database needs
nothing beyond CREATE EXTENSION pgrdf.

Two operational notes for anyone granting on pgrdf._pgrdf_quads: grant BEFORE
creating graphs (granting afterwards covers only graphs that already exist),
and grant in its OWN transaction — GRANT locks the parent while partition
creation takes the DDL gate then the parent's AccessExclusiveLock, so doing
both in one transaction can deadlock against a concurrent add_graph.

VERSION NOTE

0.6.23 is skipped and will never be tagged. That number was already allocated
to a planned type-closure release (now v0.6.25) before this work needed a
version. Versions are not reused here: a missing number is cleaner to explain
than two tags on different commits.

VERIFIED

  cargo fmt --check                                     clean
  cargo clippy --no-default-features --features pg18    -D warnings, clean
  cargo pgrx test --features pg18 pg18                  348 passed, 0 failed
  regression                                            green

v0.6.22

Toggle v0.6.22's commit message
pgRDF v0.6.22 — dual-arch trixie build parity; base bookworm→trixie; …

…repack upgrade-SQL guard (#67, supersedes v0.6.21)

v0.6.21

Toggle v0.6.21's commit message
pgRDF v0.6.21 — dual-arch trixie build parity; contractual base bookw…

…orm→trixie (#67)

v0.6.20

Toggle v0.6.20's commit message
pgRDF v0.6.20 — pgrx 0.19.1 + PostgreSQL 18

Resolves ERRATA E-006, the largest deferred upstream item: pgRDF moves from
pgrx 0.16.1 to 0.19.1 and adds PostgreSQL 18 to the supported matrix (14–18).

A build/runtime migration only — no schema change and no query-surface change.
Validated end-to-end on PostgreSQL 18.4: the full pgrx test suite, the compose
regression suite, and the W3C SPARQL/SHACL harnesses are all green (0.6.20).

- The pgrx 0.17/0.18 compile blockers (E0658 / E0716) cleared: E0658
  (`NonNull::from_mut`) is a Rust >= 1.96 gate (pgrx MSRV); E0716
  (`impl_table_iter`) is fixed by pgrx 0.18's SqlTranslatable ->
  associated-const migration. pgRDF has no hand-written SqlTranslatable impls.
- Drops the two-pass pgrx_embed bin; local builder on Rust 1.96; CI and the
  attested release chain now target PG 18.

PG 19 (currently beta) is a tracked follow-up.

Closes #63.

v0.6.19

Toggle v0.6.19's commit message
pgRDF v0.6.19 — SPARQL expression surface + differential oracle + fai…

…l-closed truncation

Scoring-loop expression surface (#50/#51: IF, numeric fns, math# tier,
aggregates over expressions), W3C differential oracle (#17), fail-closed
truncation (#14), CONSTRUCT set semantics (#54), HAVING-alias documented
extension (#55). .so + test only, no schema delta.

v0.6.18

Toggle v0.6.18's commit message
v0.6.18 — carve hardening + pg_dump dictionary fix

EXTRACT (~35x at 8.2B), #35 pg_dump _pgrdf_dictionary registration + CI round-trip.

v0.6.17

Toggle v0.6.17's commit message
v0.6.17 — carve_graph neighbourhood overload (seeds + K hops, #30)

Carve by query: carve_graph(src, seeds[], dst, max_hops) carves the K-hop
neighbourhood of a seed set into a new graph (shared dictionary, id-space
recursive-CTE BFS over the source partition). Completes C1's carve-by-query.
.so-only, no schema delta. See CHANGELOG.md [0.6.17].

v0.6.16

Toggle v0.6.16's commit message
v0.6.16 — pgrdf.carve_graph subview MVP (C1, #10)

First increment of the graph-carve chain: carve_graph(src, predicate, dst)
carves a predicated slice of a graph into a new graph in the same database
(shared dictionary, no decode). A predicated copy_graph; dst auto-created,
is_inferred carried forward, dictionary untouched. .so-only, no schema delta.
See CHANGELOG.md [0.6.16].

v0.6.15

Toggle v0.6.15's commit message
v0.6.15 — staged-loader cross-load corruption fix (#8) + carve ground…

…work (#6)

Fixes the staged loader corrupting a second load into an already-populated
dictionary: the STAGE_PREP worker now detects a non-empty dict and falls back
to the combined path, so a populated-dict load no longer fabricates duplicate
dict rows / inflates the quad count. .so-only, no schema delta. Also lands the
first graph-carve query-pattern groundwork. See CHANGELOG.md [0.6.15].