From 839a0102410b3cc4434aa0c0de35c7118c8024b2 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Wed, 2 Sep 2026 16:58:46 +0200 Subject: [PATCH] State the SQL surface a family-naming tag hides MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CREATE FUNCTION statements are what the extension deploys, so when an unshared wrapper's signatures all carry one SQL name, that name is the function's SQL surface whatever its @sqlfn tag spells. Comparing each signature against the tag alone drops every one of them where the two disagree, leaving an arity for a surface the catalog cannot state. Two kinds of tag disagree with the name beside them. The five topological bounding-box tags name a family rather than a function: MobilityDB exposes Adjacent_temporal_tstzspan as adjacent and tags it adjacent_bbox, the suffix separating contains from contains_rid in the tag namespace, and tools/scripts/check_sqlfn_names.py keeps that spelling deliberately. A laggard tag names what a function is to become rather than what it is, as contains does over the deployed cbuffer_contains. Seventy-two functions carry their signatures as a result, seventy of them the bounding-box backings, and each entry names the SQL function it registers. The five operators reach their operand pairing without a consumer inferring it: adjacent_temporal_tstzspan states its twenty adjacent(T, tstzspan) overloads rather than an arity of two. Nothing is lost or altered — no function's signatures change and none are withdrawn — and the 501 signatures added collide with no registration the catalog already carries. --- parser/sqlfn.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/parser/sqlfn.py b/parser/sqlfn.py index 61c5c40..e26099e 100644 --- a/parser/sqlfn.py +++ b/parser/sqlfn.py @@ -469,14 +469,26 @@ def attach_sqlfn_map(idl, meos_src, mdb_src, sql_src=None): # function keeps all of them and stamps the name whenever it differs. fam_names = {s["sqlName"] for s in sigs} multiname = len(fam_names) > 1 or (scoped and fam_names != {f["sqlfn"]}) + # The CREATE FUNCTION statements are what the extension deploys, so when + # an unshared wrapper's signatures all carry ONE SQL name, that name is + # this function's SQL surface whatever its tag spells. A tag names the + # family rather than the function for the five topological bounding-box + # backings — `@sqlfn contains_bbox` over a wrapper the extension exposes + # as `contains`, the suffix separating `contains` from `contains_rid` in + # the tag namespace — and trails the surface for a name still awaiting a + # rename. Comparing against the tag alone drops every signature in both + # cases, leaving the arity of a surface the catalog then cannot state. + surface = f["sqlfn"] + if surface not in fam_names and len(fam_names) == 1: + surface = next(iter(fam_names)) own = [] for s in sigs: - if not multiname and s["sqlName"] != f["sqlfn"]: + if not multiname and s["sqlName"] != surface: continue entry = {"args": s["args"], "ret": s["ret"]} if any(d is not None for d in s["argDefaults"]): entry["argDefaults"] = s["argDefaults"] - if multiname: + if multiname or s["sqlName"] != f["sqlfn"]: entry["sqlName"] = s["sqlName"] own.append(entry) if own: