Skip to content

Bind the cataloged interval_in instead of hand-wrapping pg_interval_in - #11

Merged
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:fix/bind-cataloged-interval-in
Aug 15, 2026
Merged

Bind the cataloged interval_in instead of hand-wrapping pg_interval_in#11
estebanzimanyi merged 2 commits into
MobilityDB:mainfrom
estebanzimanyi:fix/bind-cataloged-interval-in

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The branch carries the build-CI commit beneath it; the second commit is the one to review.

The binding calls the catalog canonical interval_in, and the hand-written pg_interval_in wrapper goes away: its C forward declaration, its TypeScript export, and its call site in Temporal.

The catalog carries pg_interval_in as internal, declared in pgtypes.h, and interval_in as public. The hand wrapper therefore exposed an internal spelling of a function the catalog already names publicly, and which every other binding binds.

interval_in is dropped by the generator header allow-list, which omits the header the PostgreSQL-compat base I/O is attributed to. MEOS splices those declarations into the installed <meos.h> at build time, so they are reachable through an umbrella the preamble already includes, and the omission is what forces the hand wrapper. The allow-list names both spellings of that header, since the catalog attribution moves between postgres_ext_defs.in.h and pg_interval.h.

Admitting it brings the rest of the pg-compat base I/O with it — bool, date, time, timestamp, interval, text and float8 in/out, 22 functions. Each is declared in the installed <meos.h> and exported by libmeos (nm -D).

The header allow-list itself stays. Replacing it with a projection on the catalog api field is the larger change, and it needs the umbrella attribution of the remaining public-in-subdir-header functions first.

The repository runs only a docs deployment, so nothing regenerates the
bindings, compares them against the committed sources, or type-checks the
result. Eleven hand-written wrappers reached main without consulting the MEOS
error state partly for that reason: the generator asserts the invariant, but
the assertion only fires when somebody regenerates by hand.

The job regenerates from the committed catalog, fails on any drift against
core/functions/functions.generated.ts and core/c-src/bindings.c, and type-checks.
Drift means either the generator changed without its output being refreshed or
the output was edited directly, and both leave a surface no catalog projection
produces.

Running the runtime tests needs the WebAssembly module, which the Docker
emscripten target builds and the repository does not commit, so that job is
separate work.
The binding hand-wrapped pg_interval_in: a C wrapper forward-declaring the
symbol, a TypeScript export, and a call site in Temporal. The catalog carries
pg_interval_in as internal (pgtypes.h) and the canonical interval_in as public,
so the binding exposed an internal spelling of a function it already had a
public name for, and every other binding binds the public one.

interval_in is dropped by the generator's header allow-list, which omits the
header the PostgreSQL-compat base I/O is attributed to. MEOS splices those
declarations into the installed <meos.h> at build time, so they are reachable
through an umbrella the preamble already includes; the omission is what forced
the hand wrapper. The allow-list names both spellings of that header because
the catalog attribution has moved between them.

Emitting it brings the rest of the pg-compat base I/O with it -- bool, date,
time, timestamp, interval, text and float8 in/out -- 22 functions, each
declared in the installed <meos.h> and exported by libmeos.

The generator's header allow-list itself stays. Replacing it with a projection
on the catalog's own api field is the larger change, and it needs the umbrella
attribution of the remaining public-in-subdir-header functions first.
@estebanzimanyi
estebanzimanyi merged commit 1d0dc6f into MobilityDB:main Aug 15, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the fix/bind-cataloged-interval-in branch August 15, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant