diff --git a/coverage/translation-postgres/README.md b/coverage/translation-postgres/README.md index 3a4978cb9..56fd2b0c2 100644 --- a/coverage/translation-postgres/README.md +++ b/coverage/translation-postgres/README.md @@ -16,7 +16,9 @@ file lists only what differs. case's own query, not from the input fixture every case shares (`WITH input AS (SELECT * FROM (VALUES …) AS input(ordinal, …))`). A statement the PostgreSQL parser cannot read links to no form. - `form-links.toml`: how operators, clauses, casts, lexical spellings and the query shell link to - forms. Function calls link by name. Spelling keys are read with PostgreSQL's own scanner, because + forms. Function calls link by name, and `argument-types.toml` sends a converted call to the + overload its first argument's type picks, such as `length` of `text` to the string form and not + the bytea, bit, geometry or tsvector ones; a call the converter refused links by name. Spelling keys are read with PostgreSQL's own scanner, because the shared tree reads several spellings as one: `E'…'`, `U&'…'` and `'…'` strings, `SOME` and `ANY`, `float(p)` and `real`, and every operator PostgreSQL names itself, such as `&` and `#`. An operator written the same way for integers and bit strings links to both forms. The scanner also keys the @@ -43,8 +45,9 @@ file lists only what differs. documented statement form each one is (`spelling:stmt_*`), its serial column types and its schema-qualified names, since one statement node covers several forms. `uncounted_statements` in the policy names `TRUNCATE TABLE`, whose command tag carries no count. -- `not-translatable.toml`: eleven groups, each unsigned until a reviewer signs it off in - `reviews/results.toml`. +- `not-translatable.toml`: eight groups, signed off in `reviews/results.toml`. The geometric, + network and range types are not in a group: each is a fixed algorithm DuckDB can compute, so + their forms count as translatable. - `obligations/.toml`: one obligation per generated type-combination, NULL-argument and error-parity case, and per effect case, of a live catalogue form, written from the cases' tags by `scripts/build_translation_obligations_postgres.py`; `make translation-files` fails when a diff --git a/coverage/translation-postgres/argument-types.toml b/coverage/translation-postgres/argument-types.toml new file mode 100644 index 000000000..a1bd4e4d4 --- /dev/null +++ b/coverage/translation-postgres/argument-types.toml @@ -0,0 +1,240 @@ +# For function names several PostgreSQL forms share, the type families each form's first argument +# takes, as the PostgreSQL converter names them (an array's family starts with `_`; UNKNOWN is an +# untyped NULL, which PostgreSQL resolves to text). A call whose first argument has a family links +# only to the forms listing it; a statement that records no call of the name links by name alone. + +[[form]] +id = "pg.functions.array.unnest" +first = ["_INT4", "_TEXT"] + +[[form]] +id = "pg.functions.binarystring.bit-count" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.bit-length" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.btrim" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.get-bit" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.length" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.ltrim" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.md5" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.octet-length" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.overlay-placing-from" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.position-in" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.reverse" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.rtrim" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.set-bit" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.substr" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.substring" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.trim" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.binarystring.trim-from" +first = ["BYTEA"] + +[[form]] +id = "pg.functions.bitstring.bit-count" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.bit-length" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.get-bit" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.length" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.octet-length" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.overlay-placing-from" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.position-in" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.set-bit" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.bitstring.substring" +first = ["BIT", "VARBIT"] + +[[form]] +id = "pg.functions.datetime.age" +first = ["TIMESTAMP", "TIMESTAMPTZ", "DATE"] + +[[form]] +id = "pg.functions.datetime.to-timestamp" +first = ["INT2", "INT4", "INT8", "NUMERIC", "FLOAT4", "FLOAT8", "UNKNOWN"] + +[[form]] +id = "pg.functions.formatting.to-timestamp" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.geometry.length" +first = ["LSEG", "PATH"] + +[[form]] +id = "pg.functions.info.age" +first = ["XID"] + +[[form]] +id = "pg.functions.matching.substring" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.math.trunc" +first = ["INT2", "INT4", "INT8", "NUMERIC", "FLOAT4", "FLOAT8"] + +[[form]] +id = "pg.functions.net.trunc" +first = ["MACADDR", "MACADDR8"] + +[[form]] +id = "pg.functions.range.lower" +first = ["INT4RANGE", "INT8RANGE", "NUMRANGE", "TSRANGE", "TSTZRANGE", "DATERANGE", "INT4MULTIRANGE", "INT8MULTIRANGE", "NUMMULTIRANGE", "TSMULTIRANGE", "TSTZMULTIRANGE", "DATEMULTIRANGE"] + +[[form]] +id = "pg.functions.range.unnest" +first = ["INT4MULTIRANGE", "INT8MULTIRANGE", "NUMMULTIRANGE", "TSMULTIRANGE", "TSTZMULTIRANGE", "DATEMULTIRANGE"] + +[[form]] +id = "pg.functions.range.upper" +first = ["INT4RANGE", "INT8RANGE", "NUMRANGE", "TSRANGE", "TSTZRANGE", "DATERANGE", "INT4MULTIRANGE", "INT8MULTIRANGE", "NUMMULTIRANGE", "TSMULTIRANGE", "TSTZMULTIRANGE", "DATEMULTIRANGE"] + +[[form]] +id = "pg.functions.string.bit-length" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.btrim" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.length" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.lower" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.ltrim" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.md5" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.octet-length" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.overlay-placing-from" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.position-in" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.reverse" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.rtrim" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.substr" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.substring" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.substring-from" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.substring-from-for" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.substring-similar-escape" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.trim" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.trim-from" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.string.upper" +first = ["TEXT", "VARCHAR", "BPCHAR", "NAME", "UNKNOWN"] + +[[form]] +id = "pg.functions.textsearch.length" +first = ["TSVECTOR"] + +[[form]] +id = "pg.functions.textsearch.unnest" +first = ["TSVECTOR"] diff --git a/coverage/translation-postgres/form-links.toml b/coverage/translation-postgres/form-links.toml index d3088657f..71db0faaf 100644 --- a/coverage/translation-postgres/form-links.toml +++ b/coverage/translation-postgres/form-links.toml @@ -1326,3 +1326,17 @@ reason = "The WHEN clauses are part of the MERGE form, which links by node:merge [[no_form]] constructs = ["spelling:positional_column"] reason = "A $n parameter is the positional-parameter form, which links by node:parameter." + +# These cases aggregate rows in no stated order, so PostgreSQL's recorded answer is one of several it may +# give. Each is recorded and raises aggregate_row_order; an ordered case of the same form stands in for it. +[[uncredited]] +reason = "unspecified_row_order" +cases = [ + "translation/functions/aggregate.any-value.toml#t001_types_1", + "translation/functions/aggregate.json-agg-strict.toml#t001_types_1", + "translation/functions/aggregate.json-object-agg-strict.toml#t001_types_1", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t001_types_1", + "translation/functions/aggregate.json-object-agg-unique.toml#t001_types_1", + "translation/functions/aggregate.jsonb-agg-strict.toml#t001_types_1", + "translation/functions/aggregate.string-agg.toml#t001_types_1", +] diff --git a/coverage/translation-postgres/not-translatable.toml b/coverage/translation-postgres/not-translatable.toml index 637fcefd8..70feea627 100644 --- a/coverage/translation-postgres/not-translatable.toml +++ b/coverage/translation-postgres/not-translatable.toml @@ -4,32 +4,12 @@ [[group]] id = "catalogue-and-server-state" -reason = "Administration, replication, WAL, advisory locks, object sizes and privilege checks, OID and reg* types, pseudo-types, snapshot and LSN types, money, and the event-trigger and trigger functions. They read or change a PostgreSQL server's own catalogue, processes and storage, which DuckDB does not have, so their values cannot match." +reason = "Administration, replication, WAL and recovery, advisory locks, object sizes and privilege checks, the regrole, regconfig and regdictionary types and to_regrole, which name roles and text search objects a script cannot define here, the functions that look objects up by OID or name, the current snapshot and transaction IDs, the catalogue's object definitions and the comments on shared objects, the visibility checks of conversions, operator classes and families, statistics objects and text search objects, which a script cannot define here, the server's build and version information, the pseudo-types only C-language, trigger and event-trigger functions use, and the event-trigger and trigger functions. They read or change a PostgreSQL server's own catalogue, processes, storage, build or settings from inside a query, which DuckDB does not have, so their values cannot match. The pg_get_*def functions would need PostgreSQL's deparser reproduced exactly." forms = [ - "pg.expressions.datatype-oid.oid", - "pg.expressions.datatype-oid.regclass", - "pg.expressions.datatype-oid.regcollation", "pg.expressions.datatype-oid.regconfig", "pg.expressions.datatype-oid.regdictionary", - "pg.expressions.datatype-oid.regnamespace", - "pg.expressions.datatype-oid.regoper", - "pg.expressions.datatype-oid.regoperator", - "pg.expressions.datatype-oid.regproc", - "pg.expressions.datatype-oid.regprocedure", "pg.expressions.datatype-oid.regrole", - "pg.expressions.datatype-oid.regtype", "pg.expressions.datatype-pseudo.any", - "pg.expressions.datatype-pseudo.anyarray", - "pg.expressions.datatype-pseudo.anycompatible", - "pg.expressions.datatype-pseudo.anycompatiblearray", - "pg.expressions.datatype-pseudo.anycompatiblemultirange", - "pg.expressions.datatype-pseudo.anycompatiblenonarray", - "pg.expressions.datatype-pseudo.anycompatiblerange", - "pg.expressions.datatype-pseudo.anyelement", - "pg.expressions.datatype-pseudo.anyenum", - "pg.expressions.datatype-pseudo.anymultirange", - "pg.expressions.datatype-pseudo.anynonarray", - "pg.expressions.datatype-pseudo.anyrange", "pg.expressions.datatype-pseudo.cstring", "pg.expressions.datatype-pseudo.event-trigger", "pg.expressions.datatype-pseudo.fdw-handler", @@ -37,22 +17,15 @@ forms = [ "pg.expressions.datatype-pseudo.internal", "pg.expressions.datatype-pseudo.language-handler", "pg.expressions.datatype-pseudo.pg-ddl-command", - "pg.expressions.datatype-pseudo.record", "pg.expressions.datatype-pseudo.table-am-handler", "pg.expressions.datatype-pseudo.trigger", "pg.expressions.datatype-pseudo.tsm-handler", "pg.expressions.datatype-pseudo.unknown", - "pg.expressions.datatype-pseudo.void", - "pg.expressions.datatype.money", - "pg.expressions.datatype.pg-lsn", - "pg.expressions.datatype.pg-snapshot", - "pg.expressions.datatype.txid-snapshot", "pg.expressions.info.op-at-gt", "pg.expressions.info.op-eq", "pg.functions.admin.brin-desummarize-range", "pg.functions.admin.brin-summarize-new-values", "pg.functions.admin.brin-summarize-range", - "pg.functions.admin.current-setting", "pg.functions.admin.gin-clean-pending-list", "pg.functions.admin.pg-advisory-lock", "pg.functions.admin.pg-advisory-lock-shared", @@ -68,7 +41,6 @@ forms = [ "pg.functions.admin.pg-clear-relation-stats", "pg.functions.admin.pg-collation-actual-version", "pg.functions.admin.pg-column-compression", - "pg.functions.admin.pg-column-size", "pg.functions.admin.pg-column-toast-chunk-id", "pg.functions.admin.pg-copy-logical-replication-slot", "pg.functions.admin.pg-copy-physical-replication-slot", @@ -133,7 +105,6 @@ forms = [ "pg.functions.admin.pg-restore-attribute-stats", "pg.functions.admin.pg-restore-relation-stats", "pg.functions.admin.pg-rotate-logfile", - "pg.functions.admin.pg-split-walfile-name", "pg.functions.admin.pg-stat-file", "pg.functions.admin.pg-switch-wal", "pg.functions.admin.pg-sync-replication-slots", @@ -145,21 +116,16 @@ forms = [ "pg.functions.admin.pg-try-advisory-lock-shared", "pg.functions.admin.pg-try-advisory-xact-lock", "pg.functions.admin.pg-try-advisory-xact-lock-shared", - "pg.functions.admin.pg-wal-lsn-diff", "pg.functions.admin.pg-wal-replay-pause", "pg.functions.admin.pg-wal-replay-resume", "pg.functions.admin.pg-walfile-name", "pg.functions.admin.pg-walfile-name-offset", - "pg.functions.admin.set-config", "pg.functions.event-triggers.pg-event-trigger-ddl-commands", "pg.functions.event-triggers.pg-event-trigger-dropped-objects", "pg.functions.event-triggers.pg-event-trigger-table-rewrite-oid", "pg.functions.event-triggers.pg-event-trigger-table-rewrite-reason", "pg.functions.info.acldefault", "pg.functions.info.aclexplode", - "pg.functions.info.col-description", - "pg.functions.info.collation-for", - "pg.functions.info.format-type", "pg.functions.info.has-any-column-privilege", "pg.functions.info.has-column-privilege", "pg.functions.info.has-database-privilege", @@ -177,13 +143,9 @@ forms = [ "pg.functions.info.icu-unicode-version", "pg.functions.info.makeaclitem", "pg.functions.info.mxid-age", - "pg.functions.info.obj-description", "pg.functions.info.pg-available-wal-summaries", "pg.functions.info.pg-backend-pid", - "pg.functions.info.pg-basetype", "pg.functions.info.pg-blocking-pids", - "pg.functions.info.pg-char-to-encoding", - "pg.functions.info.pg-collation-is-visible", "pg.functions.info.pg-conf-load-time", "pg.functions.info.pg-control-checkpoint", "pg.functions.info.pg-control-init", @@ -195,8 +157,6 @@ forms = [ "pg.functions.info.pg-current-xact-id", "pg.functions.info.pg-current-xact-id-if-assigned", "pg.functions.info.pg-describe-object", - "pg.functions.info.pg-encoding-to-char", - "pg.functions.info.pg-function-is-visible", "pg.functions.info.pg-get-acl", "pg.functions.info.pg-get-catalog-foreign-keys", "pg.functions.info.pg-get-constraintdef", @@ -213,7 +173,6 @@ forms = [ "pg.functions.info.pg-get-partition-constraintdef", "pg.functions.info.pg-get-partkeydef", "pg.functions.info.pg-get-ruledef", - "pg.functions.info.pg-get-serial-sequence", "pg.functions.info.pg-get-statisticsobjdef", "pg.functions.info.pg-get-triggerdef", "pg.functions.info.pg-get-userbyid", @@ -233,17 +192,11 @@ forms = [ "pg.functions.info.pg-notification-queue-usage", "pg.functions.info.pg-numa-available", "pg.functions.info.pg-opclass-is-visible", - "pg.functions.info.pg-operator-is-visible", "pg.functions.info.pg-opfamily-is-visible", - "pg.functions.info.pg-options-to-table", "pg.functions.info.pg-postmaster-start-time", "pg.functions.info.pg-safe-snapshot-blocking-pids", "pg.functions.info.pg-settings-get-flags", - "pg.functions.info.pg-snapshot-xip", - "pg.functions.info.pg-snapshot-xmax", - "pg.functions.info.pg-snapshot-xmin", "pg.functions.info.pg-statistics-obj-is-visible", - "pg.functions.info.pg-table-is-visible", "pg.functions.info.pg-tablespace-databases", "pg.functions.info.pg-tablespace-location", "pg.functions.info.pg-trigger-depth", @@ -251,32 +204,17 @@ forms = [ "pg.functions.info.pg-ts-dict-is-visible", "pg.functions.info.pg-ts-parser-is-visible", "pg.functions.info.pg-ts-template-is-visible", - "pg.functions.info.pg-type-is-visible", - "pg.functions.info.pg-visible-in-snapshot", "pg.functions.info.pg-wal-summary-contents", "pg.functions.info.pg-xact-commit-timestamp", "pg.functions.info.pg-xact-commit-timestamp-origin", "pg.functions.info.pg-xact-status", "pg.functions.info.row-security-active", "pg.functions.info.shobj-description", - "pg.functions.info.to-regclass", - "pg.functions.info.to-regcollation", - "pg.functions.info.to-regnamespace", - "pg.functions.info.to-regoper", - "pg.functions.info.to-regoperator", - "pg.functions.info.to-regproc", - "pg.functions.info.to-regprocedure", "pg.functions.info.to-regrole", - "pg.functions.info.to-regtype", - "pg.functions.info.to-regtypemod", "pg.functions.info.txid-current", "pg.functions.info.txid-current-if-assigned", "pg.functions.info.txid-current-snapshot", - "pg.functions.info.txid-snapshot-xip", - "pg.functions.info.txid-snapshot-xmax", - "pg.functions.info.txid-snapshot-xmin", "pg.functions.info.txid-status", - "pg.functions.info.txid-visible-in-snapshot", "pg.functions.info.unicode-version", "pg.functions.statistics.pg-mcv-list-items", "pg.functions.trigger.suppress-redundant-updates-trigger", @@ -284,74 +222,10 @@ forms = [ "pg.functions.trigger.tsvector-update-trigger-column", ] -[[group]] -id = "geometric-types" -reason = "The point, box, line, lseg, path, polygon and circle types and their operators and functions. DuckDB is built with only the json and icu extensions (make bundled-extensions), so it has no geometric types to translate them to." -forms = [ - "pg.expressions.datatype.box", - "pg.expressions.datatype.circle", - "pg.expressions.datatype.line", - "pg.expressions.datatype.lseg", - "pg.expressions.datatype.path", - "pg.expressions.datatype.point", - "pg.expressions.datatype.polygon", - "pg.expressions.geometry.op-amp-amp", - "pg.expressions.geometry.op-amp-gt", - "pg.expressions.geometry.op-amp-lt", - "pg.expressions.geometry.op-amp-lt-bar", - "pg.expressions.geometry.op-at-at", - "pg.expressions.geometry.op-at-gt", - "pg.expressions.geometry.op-at-minus-at", - "pg.expressions.geometry.op-bar-amp-gt", - "pg.expressions.geometry.op-bar-gt-gt", - "pg.expressions.geometry.op-gt-caret", - "pg.expressions.geometry.op-gt-gt", - "pg.expressions.geometry.op-hash", - "pg.expressions.geometry.op-hash-hash", - "pg.expressions.geometry.op-lt-at", - "pg.expressions.geometry.op-lt-caret", - "pg.expressions.geometry.op-lt-lt", - "pg.expressions.geometry.op-lt-lt-bar", - "pg.expressions.geometry.op-lt-minus-gt", - "pg.expressions.geometry.op-minus", - "pg.expressions.geometry.op-plus", - "pg.expressions.geometry.op-qmark-bar", - "pg.expressions.geometry.op-qmark-bar-bar", - "pg.expressions.geometry.op-qmark-hash", - "pg.expressions.geometry.op-qmark-minus", - "pg.expressions.geometry.op-qmark-minus-bar", - "pg.expressions.geometry.op-slash", - "pg.expressions.geometry.op-star", - "pg.expressions.geometry.op-tilde-eq", - "pg.functions.geometry.area", - "pg.functions.geometry.bound-box", - "pg.functions.geometry.box", - "pg.functions.geometry.center", - "pg.functions.geometry.circle", - "pg.functions.geometry.diagonal", - "pg.functions.geometry.diameter", - "pg.functions.geometry.height", - "pg.functions.geometry.isclosed", - "pg.functions.geometry.isopen", - "pg.functions.geometry.length", - "pg.functions.geometry.line", - "pg.functions.geometry.lseg", - "pg.functions.geometry.npoints", - "pg.functions.geometry.path", - "pg.functions.geometry.pclose", - "pg.functions.geometry.point", - "pg.functions.geometry.polygon", - "pg.functions.geometry.popen", - "pg.functions.geometry.radius", - "pg.functions.geometry.slope", - "pg.functions.geometry.width", -] - [[group]] id = "maintenance-cursors-and-files" -reason = "VACUUM, ANALYZE, CLUSTER, REINDEX, CHECKPOINT, LOAD, EXPLAIN, REFRESH, COMMENT, SECURITY LABEL, DISCARD, LOCK, LISTEN and NOTIFY, cursors, two-phase commit, SET CONSTRAINTS and SET TRANSACTION, and COPY. They manage a PostgreSQL server's storage, plans, locks, sessions or client protocol, or read and write the server's files and programs, none of which DuckDB has, so a matching result is not meaningful." +reason = "VACUUM, ANALYZE, CLUSTER, REINDEX, CHECKPOINT, LOAD, EXPLAIN, LOCK, LISTEN, NOTIFY and UNLISTEN, two-phase commit, SET CONSTRAINTS, SET TRANSACTION SNAPSHOT, and COPY. They manage a PostgreSQL server's storage, plans, locks, notifications, constraint timing, exported snapshots or client protocol, or read and write the server's files and programs, none of which DuckDB has, so a matching result is not meaningful." forms = [ - "pg.ddl.comment", "pg.dml.copy.from", "pg.dml.copy.pre-7-3-from", "pg.dml.copy.pre-7-3-to", @@ -359,30 +233,22 @@ forms = [ "pg.dml.copy.pre-9-0-to", "pg.dml.copy.to", "pg.transaction_session.commit-prepared", - "pg.transaction_session.discard", "pg.transaction_session.lock", "pg.transaction_session.prepare-transaction", "pg.transaction_session.rollback-prepared", "pg.transaction_session.set-constraints", - "pg.transaction_session.set-transaction.session-characteristics-as-transaction", - "pg.transaction_session.set-transaction.transaction", "pg.transaction_session.set-transaction.transaction-snapshot", "pg.utility.analyze", "pg.utility.analyze.pre-11", "pg.utility.checkpoint", - "pg.utility.close", "pg.utility.cluster", "pg.utility.cluster.pre-17", "pg.utility.cluster.pre-8-3", - "pg.utility.declare", "pg.utility.explain", "pg.utility.explain.pre-9-0", - "pg.utility.fetch", "pg.utility.listen", "pg.utility.load", - "pg.utility.move", "pg.utility.notify", - "pg.utility.refresh-materialized-view", "pg.utility.reindex.database-system", "pg.utility.reindex.index-table-schema", "pg.utility.unlisten", @@ -390,49 +256,11 @@ forms = [ "pg.utility.vacuum.pre-9-0", ] -[[group]] -id = "network-types" -reason = "The inet, cidr, macaddr and macaddr8 types with their functions and operators. DuckDB is built without its inet extension, and that extension has no macaddr types, so there is nothing to translate them to." -forms = [ - "pg.expressions.datatype.cidr", - "pg.expressions.datatype.inet", - "pg.expressions.datatype.macaddr", - "pg.expressions.datatype.macaddr8", - "pg.expressions.net.op-amp", - "pg.expressions.net.op-amp-amp", - "pg.expressions.net.op-bar", - "pg.expressions.net.op-gt-gt", - "pg.expressions.net.op-gt-gt-eq", - "pg.expressions.net.op-lt-lt", - "pg.expressions.net.op-lt-lt-eq", - "pg.expressions.net.op-minus", - "pg.expressions.net.op-plus", - "pg.expressions.net.op-tilde", - "pg.functions.net.abbrev", - "pg.functions.net.broadcast", - "pg.functions.net.family", - "pg.functions.net.host", - "pg.functions.net.hostmask", - "pg.functions.net.inet-merge", - "pg.functions.net.inet-same-family", - "pg.functions.net.macaddr8-set7bit", - "pg.functions.net.masklen", - "pg.functions.net.netmask", - "pg.functions.net.network", - "pg.functions.net.set-masklen", - "pg.functions.net.text", - "pg.functions.net.trunc", -] - [[group]] id = "object-kinds-duckdb-lacks" -reason = "Object kinds DuckDB does not have: foreign tables, wrappers, servers and user mappings, publications and subscriptions, triggers and rules, operators and operator classes and families, access methods, collations, conversions, languages, tablespaces, statistics objects, extensions, aggregates, casts, domains, transforms, databases and materialized views, and the ALTER TABLE actions on partitions, inheritance, storage, replica identity, triggers and rules. There is nothing in DuckDB to translate these statements to." +reason = "Object kinds DuckDB does not have: foreign tables, wrappers, servers and user mappings, publications and subscriptions, triggers and event triggers, operator classes and families, access methods, collations built from a locale, conversions, languages, tablespaces, statistics objects, extensions, transforms, base types with input and output functions, databases, large objects and schemas named for a role; and the actions that change only PostgreSQL's storage and planning: the storage, compression, statistics, tablespace, access method, clustering, logging, OIDS and replica identity actions of ALTER TABLE, ALTER INDEX and ALTER MATERIALIZED VIEW, operator, type and view options, and enabling and disabling triggers. DuckDB has nothing these statements could create or change, or a matching result is not meaningful." forms = [ - "pg.ddl.alter-aggregate.rename-to", - "pg.ddl.alter-aggregate.set-schema", "pg.ddl.alter-collation.refresh-version", - "pg.ddl.alter-collation.rename-to", - "pg.ddl.alter-collation.set-schema", "pg.ddl.alter-conversion.rename-to", "pg.ddl.alter-conversion.set-schema", "pg.ddl.alter-database.name", @@ -443,14 +271,6 @@ forms = [ "pg.ddl.alter-database.set", "pg.ddl.alter-database.set-from-current", "pg.ddl.alter-database.set-tablespace", - "pg.ddl.alter-domain.add", - "pg.ddl.alter-domain.drop-constraint", - "pg.ddl.alter-domain.name", - "pg.ddl.alter-domain.not-null", - "pg.ddl.alter-domain.rename-constraint-to", - "pg.ddl.alter-domain.rename-to", - "pg.ddl.alter-domain.set-schema", - "pg.ddl.alter-domain.validate-constraint", "pg.ddl.alter-event-trigger.disable", "pg.ddl.alter-event-trigger.enable", "pg.ddl.alter-event-trigger.rename-to", @@ -502,12 +322,9 @@ forms = [ "pg.ddl.alter-materialized-view.alter-set-storage", "pg.ddl.alter-materialized-view.cluster-on", "pg.ddl.alter-materialized-view.depends-on-extension", - "pg.ddl.alter-materialized-view.rename-to", - "pg.ddl.alter-materialized-view.rename-to-column", "pg.ddl.alter-materialized-view.reset", "pg.ddl.alter-materialized-view.set", "pg.ddl.alter-materialized-view.set-access-method", - "pg.ddl.alter-materialized-view.set-schema", "pg.ddl.alter-materialized-view.set-tablespace", "pg.ddl.alter-materialized-view.set-without-cluster", "pg.ddl.alter-operator-class.rename-to", @@ -517,14 +334,11 @@ forms = [ "pg.ddl.alter-operator-family.rename-to", "pg.ddl.alter-operator-family.set-schema", "pg.ddl.alter-operator.set", - "pg.ddl.alter-operator.set-schema", "pg.ddl.alter-publication.add", "pg.ddl.alter-publication.drop", "pg.ddl.alter-publication.rename-to", "pg.ddl.alter-publication.set-name-publication-object", "pg.ddl.alter-publication.set-name-publication-parameter", - "pg.ddl.alter-rule", - "pg.ddl.alter-schema.rename-to", "pg.ddl.alter-server.name", "pg.ddl.alter-server.rename-to", "pg.ddl.alter-statistics.rename-to", @@ -545,22 +359,11 @@ forms = [ "pg.ddl.alter-table.alter-set-compression", "pg.ddl.alter-table.alter-set-statistics", "pg.ddl.alter-table.alter-set-storage", - "pg.ddl.alter-table.attach-partition", "pg.ddl.alter-table.cluster-on", - "pg.ddl.alter-table.detach-partition", - "pg.ddl.alter-table.disable-rule", "pg.ddl.alter-table.disable-trigger", - "pg.ddl.alter-table.enable-always-rule", "pg.ddl.alter-table.enable-always-trigger", - "pg.ddl.alter-table.enable-replica-rule", "pg.ddl.alter-table.enable-replica-trigger", - "pg.ddl.alter-table.enable-rule", "pg.ddl.alter-table.enable-trigger", - "pg.ddl.alter-table.inherit", - "pg.ddl.alter-table.no-force-row-level", - "pg.ddl.alter-table.no-inherit", - "pg.ddl.alter-table.not-of", - "pg.ddl.alter-table.of", "pg.ddl.alter-table.replica-identity", "pg.ddl.alter-table.reset", "pg.ddl.alter-table.set", @@ -578,17 +381,9 @@ forms = [ "pg.ddl.alter-view.reset", "pg.ddl.alter-view.set", "pg.ddl.create-access-method", - "pg.ddl.create-aggregate.basetype-sfunc-stype", - "pg.ddl.create-aggregate.order-by-sfunc-stype", - "pg.ddl.create-aggregate.sfunc-stype", - "pg.ddl.create-cast.with-function", - "pg.ddl.create-cast.with-inout", - "pg.ddl.create-cast.without-function", - "pg.ddl.create-collation.from", "pg.ddl.create-collation.name", "pg.ddl.create-conversion", "pg.ddl.create-database", - "pg.ddl.create-domain", "pg.ddl.create-event-trigger", "pg.ddl.create-extension", "pg.ddl.create-foreign-data-wrapper", @@ -596,42 +391,30 @@ forms = [ "pg.ddl.create-foreign-table.server", "pg.ddl.create-language.handler", "pg.ddl.create-language.name", - "pg.ddl.create-materialized-view", - "pg.ddl.create-operator", "pg.ddl.create-operator-class", "pg.ddl.create-operator-family", "pg.ddl.create-publication", - "pg.ddl.create-rule", "pg.ddl.create-schema.authorization", "pg.ddl.create-schema.if-not-exists-authorization", "pg.ddl.create-server", "pg.ddl.create-statistics.from-table-name", "pg.ddl.create-statistics.table-name", "pg.ddl.create-subscription", - "pg.ddl.create-table.partition-of", "pg.ddl.create-tablespace", "pg.ddl.create-transform", "pg.ddl.create-trigger", - "pg.ddl.create-type.as-range-subtype", "pg.ddl.create-type.input-output", "pg.ddl.drop-access-method", - "pg.ddl.drop-aggregate", - "pg.ddl.drop-cast", - "pg.ddl.drop-collation", "pg.ddl.drop-conversion", "pg.ddl.drop-database", - "pg.ddl.drop-domain", "pg.ddl.drop-event-trigger", "pg.ddl.drop-extension", "pg.ddl.drop-foreign-data-wrapper", "pg.ddl.drop-foreign-table", "pg.ddl.drop-language", - "pg.ddl.drop-materialized-view", - "pg.ddl.drop-operator", "pg.ddl.drop-operator-class", "pg.ddl.drop-operator-family", "pg.ddl.drop-publication", - "pg.ddl.drop-rule", "pg.ddl.drop-server", "pg.ddl.drop-statistics", "pg.ddl.drop-subscription", @@ -643,92 +426,43 @@ forms = [ [[group]] id = "procedural" -reason = "DO, CALL and CREATE, ALTER and DROP of functions, procedures and routines. DuckDB has no procedural language to translate them into; SQL-bodied functions could become macros, but their strictness, volatility and argument coercion differ." +reason = "DO, and the ALTER FUNCTION, PROCEDURE and ROUTINE actions that set planner hints (COST, ROWS, PARALLEL, LEAKPROOF, SUPPORT and volatility), SECURITY DEFINER or INVOKER, extension dependencies, or settings for a routine's calls. DuckDB has no procedural language to run a DO block in and cannot scope a setting or a privilege context to one call, and the planner hints change no result, so a matching result is not possible or not meaningful." forms = [ - "pg.ddl.alter-function.called-on-null-input", "pg.ddl.alter-function.cost", "pg.ddl.alter-function.depends-on-extension", "pg.ddl.alter-function.immutable-stable-volatile", "pg.ddl.alter-function.leakproof", "pg.ddl.alter-function.parallel", - "pg.ddl.alter-function.rename-to", "pg.ddl.alter-function.reset", "pg.ddl.alter-function.reset-all", "pg.ddl.alter-function.rows", "pg.ddl.alter-function.security-invoker-security-definer", "pg.ddl.alter-function.set", "pg.ddl.alter-function.set-from-current", - "pg.ddl.alter-function.set-schema", "pg.ddl.alter-function.support", "pg.ddl.alter-procedure.depends-on-extension", - "pg.ddl.alter-procedure.rename-to", "pg.ddl.alter-procedure.reset", "pg.ddl.alter-procedure.reset-all", "pg.ddl.alter-procedure.security-invoker-security-definer", "pg.ddl.alter-procedure.set", "pg.ddl.alter-procedure.set-from-current", - "pg.ddl.alter-procedure.set-schema", "pg.ddl.alter-routine.cost", "pg.ddl.alter-routine.depends-on-extension", "pg.ddl.alter-routine.immutable-stable-volatile", "pg.ddl.alter-routine.leakproof", "pg.ddl.alter-routine.parallel", - "pg.ddl.alter-routine.rename-to", "pg.ddl.alter-routine.reset", "pg.ddl.alter-routine.reset-all", "pg.ddl.alter-routine.rows", "pg.ddl.alter-routine.security-invoker-security-definer", "pg.ddl.alter-routine.set", "pg.ddl.alter-routine.set-from-current", - "pg.ddl.alter-routine.set-schema", - "pg.ddl.create-function", - "pg.ddl.create-function.sql-body-atomic", - "pg.ddl.create-function.sql-body-return", - "pg.ddl.create-procedure", - "pg.ddl.create-procedure.sql-body-atomic", - "pg.ddl.drop-function", - "pg.ddl.drop-procedure", - "pg.ddl.drop-routine", - "pg.utility.call", "pg.utility.do", ] -[[group]] -id = "ranges-and-multiranges" -reason = "Range and multirange types with their operators, functions and aggregates. DuckDB has no range types; emulating PostgreSQL's canonical forms, bounds and operators would be a large rule set with no DuckDB type to hold the results." -forms = [ - "pg.expressions.range.op-amp-amp", - "pg.expressions.range.op-amp-gt", - "pg.expressions.range.op-amp-lt", - "pg.expressions.range.op-at-gt", - "pg.expressions.range.op-gt-gt", - "pg.expressions.range.op-lt-at", - "pg.expressions.range.op-lt-lt", - "pg.expressions.range.op-minus", - "pg.expressions.range.op-minus-bar-minus", - "pg.expressions.range.op-plus", - "pg.expressions.range.op-star", - "pg.expressions.rangetypes.builtin-multirange-types", - "pg.expressions.rangetypes.builtin-range-types", - "pg.expressions.rangetypes.multirange-constructor", - "pg.expressions.rangetypes.range-constructor", - "pg.functions.aggregate.range-agg", - "pg.functions.aggregate.range-intersect-agg", - "pg.functions.range.isempty", - "pg.functions.range.lower", - "pg.functions.range.lower-inc", - "pg.functions.range.lower-inf", - "pg.functions.range.multirange", - "pg.functions.range.range-merge", - "pg.functions.range.unnest", - "pg.functions.range.upper", - "pg.functions.range.upper-inc", - "pg.functions.range.upper-inf", -] - [[group]] id = "security-and-roles" -reason = "Roles, GRANT and REVOKE, policies and row-level security, SET ROLE, SET SESSION AUTHORIZATION and OWNER TO. DuckDB has no roles, users or privileges, so there is nothing to translate these statements to." +reason = "Roles, users and groups, GRANT and REVOKE, default privileges, user mappings, SECURITY LABEL, ALTER SYSTEM, DROP OWNED and REASSIGN OWNED, SET ROLE, SET SESSION AUTHORIZATION and OWNER TO. DuckDB has no roles, users, privileges or server configuration, so there is nothing to translate these statements to. GRANT and REVOKE would need invented errors to match PostgreSQL's privilege failures." forms = [ "pg.ddl.alter-aggregate.owner-to", "pg.ddl.alter-collation.owner-to", @@ -752,9 +486,6 @@ forms = [ "pg.ddl.alter-server.owner-to", "pg.ddl.alter-statistics.owner-to", "pg.ddl.alter-subscription.owner-to", - "pg.ddl.alter-table.disable-row-level-security", - "pg.ddl.alter-table.enable-row-level-security", - "pg.ddl.alter-table.force-row-level-security", "pg.ddl.alter-table.owner-to", "pg.ddl.alter-tablespace.owner-to", "pg.ddl.alter-type.owner-to", @@ -763,8 +494,6 @@ forms = [ "pg.security_admin.alter-group.add-user", "pg.security_admin.alter-group.drop-user", "pg.security_admin.alter-group.rename-to", - "pg.security_admin.alter-policy.on-table-name", - "pg.security_admin.alter-policy.rename-to", "pg.security_admin.alter-role.rename-to", "pg.security_admin.alter-role.reset", "pg.security_admin.alter-role.reset-all", @@ -782,7 +511,6 @@ forms = [ "pg.security_admin.alter-user.set", "pg.security_admin.alter-user.set-from-current", "pg.security_admin.create-group", - "pg.security_admin.create-policy", "pg.security_admin.create-role", "pg.security_admin.create-role.in-group", "pg.security_admin.create-role.with-user", @@ -790,7 +518,6 @@ forms = [ "pg.security_admin.create-user-mapping", "pg.security_admin.drop-group", "pg.security_admin.drop-owned", - "pg.security_admin.drop-policy", "pg.security_admin.drop-role", "pg.security_admin.drop-user", "pg.security_admin.drop-user-mapping", @@ -836,9 +563,8 @@ forms = [ [[group]] id = "session-and-randomness" -reason = "now() and the other clocks, the current_* and user functions, version(), random, gen_random_uuid, uuidv4 and uuidv7, pg_sleep and the client and server address functions. Their values depend on when, where and by whom PostgreSQL runs them, or on its random generator, so a DuckDB run cannot give the same value." +reason = "now() and the other clocks, the current_user, current_role, session_user, system_user, user, current_database and current_catalog functions, current_query, version(), random_normal, gen_random_uuid, uuidv4 and uuidv7, the client and server address functions, and age of a transaction ID. Their values depend on when, where, by whom or through which client text PostgreSQL runs them, on the server's build or transactions, or on its random generator, so a DuckDB run cannot give the same value. current_query returns the text the client sent." forms = [ - "pg.functions.datetime.age", "pg.functions.datetime.clock-timestamp", "pg.functions.datetime.current-date-noparens", "pg.functions.datetime.current-time", @@ -846,7 +572,6 @@ forms = [ "pg.functions.datetime.localtime", "pg.functions.datetime.localtimestamp", "pg.functions.datetime.now", - "pg.functions.datetime.pg-sleep", "pg.functions.datetime.statement-timestamp", "pg.functions.datetime.timeofday", "pg.functions.datetime.transaction-timestamp", @@ -855,9 +580,6 @@ forms = [ "pg.functions.info.current-database", "pg.functions.info.current-query", "pg.functions.info.current-role-noparens", - "pg.functions.info.current-schema", - "pg.functions.info.current-schema-noparens", - "pg.functions.info.current-schemas", "pg.functions.info.current-user-noparens", "pg.functions.info.inet-client-addr", "pg.functions.info.inet-client-port", @@ -867,9 +589,7 @@ forms = [ "pg.functions.info.system-user-noparens", "pg.functions.info.user-noparens", "pg.functions.info.version", - "pg.functions.math.random", "pg.functions.math.random-normal", - "pg.functions.math.setseed", "pg.functions.uuid.gen-random-uuid", "pg.functions.uuid.uuidv4", "pg.functions.uuid.uuidv7", @@ -877,7 +597,7 @@ forms = [ [[group]] id = "text-search" -reason = "tsvector and tsquery, their functions and operators, and text search configurations, dictionaries, parsers and templates. They compute PostgreSQL's own parsing, stemming and ranking; DuckDB's full-text search extension is a different model and is not bundled, so the values cannot match." +reason = "Text search configurations, dictionaries, parsers and templates, and the functions that run them: to_tsvector, json_to_tsvector, jsonb_to_tsvector, to_tsquery, plainto_tsquery, phraseto_tsquery, websearch_to_tsquery, ts_debug, ts_parse, ts_lexize, ts_token_type, ts_headline, ts_stat and get_current_ts_config. They run PostgreSQL's text search parser, dictionaries and stemmers; DuckDB's full-text search extension is a different model and is not bundled, so their values cannot match." forms = [ "pg.ddl.alter-text-search-configuration.add-mapping-for-with", "pg.ddl.alter-text-search-configuration.alter-mapping-for-replace", @@ -903,82 +623,43 @@ forms = [ "pg.ddl.drop-text-search-dictionary", "pg.ddl.drop-text-search-parser", "pg.ddl.drop-text-search-template", - "pg.expressions.datatype.tsquery", - "pg.expressions.datatype.tsvector", - "pg.expressions.textsearch.op-amp-amp", - "pg.expressions.textsearch.op-at-at", - "pg.expressions.textsearch.op-at-gt", - "pg.expressions.textsearch.op-bang-bang", - "pg.expressions.textsearch.op-bar-bar", - "pg.expressions.textsearch.op-lt-at", - "pg.expressions.textsearch.op-lt-minus-gt", - "pg.functions.textsearch.array-to-tsvector", "pg.functions.textsearch.get-current-ts-config", "pg.functions.textsearch.json-to-tsvector", "pg.functions.textsearch.jsonb-to-tsvector", - "pg.functions.textsearch.length", - "pg.functions.textsearch.numnode", "pg.functions.textsearch.phraseto-tsquery", "pg.functions.textsearch.plainto-tsquery", - "pg.functions.textsearch.querytree", - "pg.functions.textsearch.setweight", - "pg.functions.textsearch.strip", "pg.functions.textsearch.to-tsquery", "pg.functions.textsearch.to-tsvector", "pg.functions.textsearch.ts-debug", - "pg.functions.textsearch.ts-delete", - "pg.functions.textsearch.ts-filter", "pg.functions.textsearch.ts-headline", "pg.functions.textsearch.ts-lexize", "pg.functions.textsearch.ts-parse", - "pg.functions.textsearch.ts-rank", - "pg.functions.textsearch.ts-rank-cd", - "pg.functions.textsearch.ts-rewrite", "pg.functions.textsearch.ts-stat", "pg.functions.textsearch.ts-token-type", - "pg.functions.textsearch.tsquery-phrase", - "pg.functions.textsearch.tsvector-to-array", - "pg.functions.textsearch.unnest", "pg.functions.textsearch.websearch-to-tsquery", ] [[group]] id = "xml" -reason = "The xml type, the xml* functions, XPath and XMLTABLE. DuckDB has no XML type or functions to translate them to." +reason = "The xml type and its input, XMLPARSE, xmlroot, IS DOCUMENT, xml_is_well_formed, xpath, xpath_exists, XMLEXISTS and XMLTABLE, the mappings to XML that write the database's name (database_to_xml, database_to_xmlschema, database_to_xml_and_xmlschema, schema_to_xmlschema, schema_to_xml_and_xmlschema, table_to_xmlschema and table_to_xml_and_xmlschema), and SET XML OPTION. They parse XML or evaluate XPath as libxml2 does, or write the name of the database PostgreSQL runs in, as current_database does, and DuckDB has no XML parser, type or functions, so their values cannot match." forms = [ "pg.expressions.datatype.xml", "pg.expressions.xml.is-document", "pg.expressions.xml.is-not-document", - "pg.functions.aggregate.xmlagg-order-by", "pg.functions.datatype-xml.xmlparse", - "pg.functions.datatype-xml.xmlserialize-as", - "pg.functions.xml.cursor-to-xml", - "pg.functions.xml.cursor-to-xmlschema", "pg.functions.xml.database-to-xml", "pg.functions.xml.database-to-xml-and-xmlschema", "pg.functions.xml.database-to-xmlschema", - "pg.functions.xml.query-to-xml", - "pg.functions.xml.query-to-xml-and-xmlschema", - "pg.functions.xml.query-to-xmlschema", - "pg.functions.xml.schema-to-xml", "pg.functions.xml.schema-to-xml-and-xmlschema", "pg.functions.xml.schema-to-xmlschema", - "pg.functions.xml.table-to-xml", "pg.functions.xml.table-to-xml-and-xmlschema", "pg.functions.xml.table-to-xmlschema", "pg.functions.xml.xml-is-well-formed", "pg.functions.xml.xml-is-well-formed-content", "pg.functions.xml.xml-is-well-formed-document", - "pg.functions.xml.xmlagg", - "pg.functions.xml.xmlcomment", - "pg.functions.xml.xmlconcat", - "pg.functions.xml.xmlelement-name", "pg.functions.xml.xmlexists-passing", - "pg.functions.xml.xmlforest", - "pg.functions.xml.xmlpi-name", "pg.functions.xml.xmlroot-version", "pg.functions.xml.xmltable-passing-columns", - "pg.functions.xml.xmltext", "pg.functions.xml.xpath", "pg.functions.xml.xpath-exists", "pg.transaction_session.datatype-xml.set-xml-option", diff --git a/coverage/translation-postgres/obligations/functions.toml b/coverage/translation-postgres/obligations/functions.toml index 6ae517410..48f29f4d0 100644 --- a/coverage/translation-postgres/obligations/functions.toml +++ b/coverage/translation-postgres/obligations/functions.toml @@ -8,6 +8,28 @@ id = "pg.functions.aggregate.any-value.t001" form = "pg.functions.aggregate.any-value" kind = "type_combination" target = "integer" +note = "any_value over rows holding one integer and NULLs Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.any-value.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.any-value.t002" +form = "pg.functions.aggregate.any-value" +kind = "type_combination" +target = "text" +note = "any_value over rows holding one text Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.any-value.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.any-value.t003" +form = "pg.functions.aggregate.any-value" +kind = "type_combination" +target = "integer" note = "any_value with arguments of type integer." catches = "the argument types read another way, or the result typed otherwise" reading = "the argument types the generator read from the function's page" @@ -15,7 +37,7 @@ cases = ["cases/translation/functions/aggregate.any-value.toml#t001_types_1"] required = true [[obligation]] -id = "pg.functions.aggregate.any-value.t002" +id = "pg.functions.aggregate.any-value.t004" form = "pg.functions.aggregate.any-value" kind = "null_argument" target = "integer" @@ -26,7 +48,7 @@ cases = ["cases/translation/functions/aggregate.any-value.toml#t002_null_1"] required = true [[obligation]] -id = "pg.functions.aggregate.any-value.t003" +id = "pg.functions.aggregate.any-value.t005" form = "pg.functions.aggregate.any-value" kind = "error_parity" target = "text" @@ -36,6 +58,39 @@ reading = "the argument types the generator read from the function's page" cases = ["cases/translation/functions/aggregate.any-value.toml#t005_wrong_kind"] required = true +[[obligation]] +id = "pg.functions.aggregate.array-agg-order-by.t001" +form = "pg.functions.aggregate.array-agg-order-by" +kind = "type_combination" +target = "integer" +note = "array_agg of integers ordered descending Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.array-agg-order-by.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.array-agg-order-by.t002" +form = "pg.functions.aggregate.array-agg-order-by" +kind = "type_combination" +target = "text, integer" +note = "array_agg of text ordered by another column Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.array-agg-order-by.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.array-agg-order-by.t003" +form = "pg.functions.aggregate.array-agg-order-by" +kind = "null_argument" +target = "integer" +note = "array_agg of only NULL Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.array-agg-order-by.hand.toml#h003"] +required = true + [[obligation]] id = "pg.functions.aggregate.avg.t001" form = "pg.functions.aggregate.avg" @@ -630,11 +685,77 @@ reading = "the argument types the generator read from the function's page" cases = ["cases/translation/functions/aggregate.every.toml#t003_wrong_kind"] required = true +[[obligation]] +id = "pg.functions.aggregate.json-agg-order-by.t001" +form = "pg.functions.aggregate.json-agg-order-by" +kind = "type_combination" +target = "integer, integer" +note = "json_agg ordered by another column, rows tied on it holding one value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-order-by.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-agg-order-by.t002" +form = "pg.functions.aggregate.json-agg-order-by" +kind = "type_combination" +target = "text" +note = "json_agg of text ordered descending with NULLs last Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-order-by.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-agg-order-by.t003" +form = "pg.functions.aggregate.json-agg-order-by" +kind = "null_argument" +target = "integer" +note = "json_agg of only NULL Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-order-by.hand.toml#h003"] +required = true + [[obligation]] id = "pg.functions.aggregate.json-agg-strict.t001" form = "pg.functions.aggregate.json-agg-strict" kind = "type_combination" target = "integer" +note = "json_agg_strict of integers ordered by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-strict.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-agg-strict.t002" +form = "pg.functions.aggregate.json-agg-strict" +kind = "type_combination" +target = "text" +note = "json_agg_strict of text ordered descending Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-strict.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-agg-strict.t003" +form = "pg.functions.aggregate.json-agg-strict" +kind = "null_argument" +target = "integer" +note = "json_agg_strict of only NULL Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-agg-strict.hand.toml#h003"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-agg-strict.t004" +form = "pg.functions.aggregate.json-agg-strict" +kind = "type_combination" +target = "integer" note = "json_agg_strict with arguments of type integer." catches = "the argument types read another way, or the result typed otherwise" reading = "the argument types the generator read from the function's page" @@ -642,7 +763,7 @@ cases = ["cases/translation/functions/aggregate.json-agg-strict.toml#t001_types_ required = true [[obligation]] -id = "pg.functions.aggregate.json-agg-strict.t002" +id = "pg.functions.aggregate.json-agg-strict.t005" form = "pg.functions.aggregate.json-agg-strict" kind = "null_argument" target = "integer" @@ -653,7 +774,7 @@ cases = ["cases/translation/functions/aggregate.json-agg-strict.toml#t002_null_1 required = true [[obligation]] -id = "pg.functions.aggregate.json-agg-strict.t003" +id = "pg.functions.aggregate.json-agg-strict.t006" form = "pg.functions.aggregate.json-agg-strict" kind = "error_parity" target = "text" @@ -674,10 +795,54 @@ reading = "the argument types the generator read from the function's page" cases = ["cases/translation/functions/aggregate.json-arrayagg.toml#t001_literal"] required = true +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-order-by.t001" +form = "pg.functions.aggregate.json-object-agg-order-by" +kind = "type_combination" +target = "text, integer" +note = "json_object_agg ordered by the key Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-order-by.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-order-by.t002" +form = "pg.functions.aggregate.json-object-agg-order-by" +kind = "type_combination" +target = "integer, integer" +note = "json_object_agg of integer keys ordered descending by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-order-by.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-order-by.t003" +form = "pg.functions.aggregate.json-object-agg-order-by" +kind = "null_argument" +target = "text, integer" +note = "json_object_agg of a NULL key Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-order-by.hand.toml#h003"] +required = true + [[obligation]] id = "pg.functions.aggregate.json-object-agg-strict.t001" form = "pg.functions.aggregate.json-object-agg-strict" kind = "type_combination" +target = "text, integer" +note = "json_object_agg_strict ordered by the key Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-strict.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-strict.t002" +form = "pg.functions.aggregate.json-object-agg-strict" +kind = "type_combination" target = "integer, integer" note = "json_object_agg_strict with arguments of type integer, integer." catches = "the argument types read another way, or the result typed otherwise" @@ -686,7 +851,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-strict.toml#t001 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-strict.t002" +id = "pg.functions.aggregate.json-object-agg-strict.t003" form = "pg.functions.aggregate.json-object-agg-strict" kind = "null_argument" target = "integer, integer" @@ -697,7 +862,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-strict.toml#t002 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-strict.t003" +id = "pg.functions.aggregate.json-object-agg-strict.t004" form = "pg.functions.aggregate.json-object-agg-strict" kind = "null_argument" target = "integer, integer" @@ -708,7 +873,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-strict.toml#t003 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-strict.t004" +id = "pg.functions.aggregate.json-object-agg-strict.t005" form = "pg.functions.aggregate.json-object-agg-strict" kind = "error_parity" target = "text, integer" @@ -722,6 +887,28 @@ required = true id = "pg.functions.aggregate.json-object-agg-unique.t001" form = "pg.functions.aggregate.json-object-agg-unique" kind = "type_combination" +target = "text, integer" +note = "json_object_agg_unique ordered by the key Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-unique.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-unique.t002" +form = "pg.functions.aggregate.json-object-agg-unique" +kind = "error_parity" +target = "text, integer" +note = "json_object_agg_unique of a repeated key Hand-written." +catches = "a value returned where PostgreSQL rejects the arguments, or another error kind" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-unique.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-unique.t003" +form = "pg.functions.aggregate.json-object-agg-unique" +kind = "type_combination" target = "integer, integer" note = "json_object_agg_unique with arguments of type integer, integer." catches = "the argument types read another way, or the result typed otherwise" @@ -730,7 +917,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique.toml#t001 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique.t002" +id = "pg.functions.aggregate.json-object-agg-unique.t004" form = "pg.functions.aggregate.json-object-agg-unique" kind = "null_argument" target = "integer, integer" @@ -741,7 +928,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique.toml#t002 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique.t003" +id = "pg.functions.aggregate.json-object-agg-unique.t005" form = "pg.functions.aggregate.json-object-agg-unique" kind = "null_argument" target = "integer, integer" @@ -752,7 +939,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique.toml#t003 required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique.t004" +id = "pg.functions.aggregate.json-object-agg-unique.t006" form = "pg.functions.aggregate.json-object-agg-unique" kind = "error_parity" target = "text, integer" @@ -766,6 +953,17 @@ required = true id = "pg.functions.aggregate.json-object-agg-unique-strict.t001" form = "pg.functions.aggregate.json-object-agg-unique-strict" kind = "type_combination" +target = "text, integer" +note = "json_object_agg_unique_strict ordered by the key Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.json-object-agg-unique-strict.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.json-object-agg-unique-strict.t002" +form = "pg.functions.aggregate.json-object-agg-unique-strict" +kind = "type_combination" target = "integer, integer" note = "json_object_agg_unique_strict with arguments of type integer, integer." catches = "the argument types read another way, or the result typed otherwise" @@ -774,7 +972,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique-strict.to required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique-strict.t002" +id = "pg.functions.aggregate.json-object-agg-unique-strict.t003" form = "pg.functions.aggregate.json-object-agg-unique-strict" kind = "null_argument" target = "integer, integer" @@ -785,7 +983,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique-strict.to required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique-strict.t003" +id = "pg.functions.aggregate.json-object-agg-unique-strict.t004" form = "pg.functions.aggregate.json-object-agg-unique-strict" kind = "null_argument" target = "integer, integer" @@ -796,7 +994,7 @@ cases = ["cases/translation/functions/aggregate.json-object-agg-unique-strict.to required = true [[obligation]] -id = "pg.functions.aggregate.json-object-agg-unique-strict.t004" +id = "pg.functions.aggregate.json-object-agg-unique-strict.t005" form = "pg.functions.aggregate.json-object-agg-unique-strict" kind = "error_parity" target = "text, integer" @@ -817,11 +1015,77 @@ reading = "the argument types the generator read from the function's page" cases = ["cases/translation/functions/aggregate.json-objectagg.toml#t001_literal"] required = true +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-order-by.t001" +form = "pg.functions.aggregate.jsonb-agg-order-by" +kind = "type_combination" +target = "integer, integer" +note = "jsonb_agg ordered by another column Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-order-by.t002" +form = "pg.functions.aggregate.jsonb-agg-order-by" +kind = "type_combination" +target = "text" +note = "jsonb_agg of text ordered by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-order-by.t003" +form = "pg.functions.aggregate.jsonb-agg-order-by" +kind = "null_argument" +target = "integer" +note = "jsonb_agg of only NULL Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h003"] +required = true + [[obligation]] id = "pg.functions.aggregate.jsonb-agg-strict.t001" form = "pg.functions.aggregate.jsonb-agg-strict" kind = "type_combination" target = "integer" +note = "jsonb_agg_strict of integers ordered by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-strict.t002" +form = "pg.functions.aggregate.jsonb-agg-strict" +kind = "type_combination" +target = "text" +note = "jsonb_agg_strict of text ordered descending Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-strict.t003" +form = "pg.functions.aggregate.jsonb-agg-strict" +kind = "null_argument" +target = "integer" +note = "jsonb_agg_strict of only NULL Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.hand.toml#h003"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-agg-strict.t004" +form = "pg.functions.aggregate.jsonb-agg-strict" +kind = "type_combination" +target = "integer" note = "jsonb_agg_strict with arguments of type integer." catches = "the argument types read another way, or the result typed otherwise" reading = "the argument types the generator read from the function's page" @@ -829,7 +1093,7 @@ cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.toml#t001_types required = true [[obligation]] -id = "pg.functions.aggregate.jsonb-agg-strict.t002" +id = "pg.functions.aggregate.jsonb-agg-strict.t005" form = "pg.functions.aggregate.jsonb-agg-strict" kind = "null_argument" target = "integer" @@ -840,7 +1104,7 @@ cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.toml#t002_null_ required = true [[obligation]] -id = "pg.functions.aggregate.jsonb-agg-strict.t003" +id = "pg.functions.aggregate.jsonb-agg-strict.t006" form = "pg.functions.aggregate.jsonb-agg-strict" kind = "error_parity" target = "text" @@ -850,6 +1114,28 @@ reading = "the argument types the generator read from the function's page" cases = ["cases/translation/functions/aggregate.jsonb-agg-strict.toml#t005_wrong_kind"] required = true +[[obligation]] +id = "pg.functions.aggregate.jsonb-object-agg-order-by.t001" +form = "pg.functions.aggregate.jsonb-object-agg-order-by" +kind = "type_combination" +target = "text, integer" +note = "jsonb_object_agg ordered by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-object-agg-order-by.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.jsonb-object-agg-order-by.t002" +form = "pg.functions.aggregate.jsonb-object-agg-order-by" +kind = "null_argument" +target = "text, integer" +note = "jsonb_object_agg with a NULL value Hand-written." +catches = "a NULL argument returning a value, or raising where PostgreSQL returns NULL" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.jsonb-object-agg-order-by.hand.toml#h002"] +required = true + [[obligation]] id = "pg.functions.aggregate.jsonb-object-agg-strict.t001" form = "pg.functions.aggregate.jsonb-object-agg-strict" @@ -1845,6 +2131,28 @@ id = "pg.functions.aggregate.string-agg.t001" form = "pg.functions.aggregate.string-agg" kind = "type_combination" target = "text, text" +note = "string_agg with each row's own separator, ordered by the value Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.string-agg.hand.toml#h001"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.string-agg.t002" +form = "pg.functions.aggregate.string-agg" +kind = "type_combination" +target = "text, integer" +note = "string_agg ordered by another column Hand-written." +catches = "the argument types read another way, or the result typed otherwise" +reading = "the argument types the generator read from the function's page" +cases = ["cases/translation/functions/aggregate.string-agg.hand.toml#h002"] +required = true + +[[obligation]] +id = "pg.functions.aggregate.string-agg.t003" +form = "pg.functions.aggregate.string-agg" +kind = "type_combination" +target = "text, text" note = "string_agg with arguments of type text, text." catches = "the argument types read another way, or the result typed otherwise" reading = "the argument types the generator read from the function's page" @@ -1852,7 +2160,7 @@ cases = ["cases/translation/functions/aggregate.string-agg.toml#t001_types_1"] required = true [[obligation]] -id = "pg.functions.aggregate.string-agg.t002" +id = "pg.functions.aggregate.string-agg.t004" form = "pg.functions.aggregate.string-agg" kind = "null_argument" target = "text, text" @@ -1863,7 +2171,7 @@ cases = ["cases/translation/functions/aggregate.string-agg.toml#t002_null_1"] required = true [[obligation]] -id = "pg.functions.aggregate.string-agg.t003" +id = "pg.functions.aggregate.string-agg.t005" form = "pg.functions.aggregate.string-agg" kind = "null_argument" target = "text, text" @@ -1874,7 +2182,7 @@ cases = ["cases/translation/functions/aggregate.string-agg.toml#t003_null_2"] required = true [[obligation]] -id = "pg.functions.aggregate.string-agg.t004" +id = "pg.functions.aggregate.string-agg.t006" form = "pg.functions.aggregate.string-agg" kind = "error_parity" target = "integer[], text" diff --git a/coverage/translation-postgres/results-baseline.json b/coverage/translation-postgres/results-baseline.json index 87d976cf7..18f67396f 100644 --- a/coverage/translation-postgres/results-baseline.json +++ b/coverage/translation-postgres/results-baseline.json @@ -503,7 +503,7 @@ "translation/expressions/datetime.op-minus.toml#t002_null_1": "matching", "translation/expressions/datetime.op-minus.toml#t003_boundary_1": "matching", "translation/expressions/datetime.op-minus.toml#t004_boundary_2": "matching", - "translation/expressions/datetime.op-minus.toml#t005_wrong_kind": "refused", + "translation/expressions/datetime.op-minus.toml#t005_wrong_kind": "matching_rejection", "translation/expressions/datetime.op-plus.hand.toml#h001": "matching", "translation/expressions/datetime.op-plus.hand.toml#h002": "matching", "translation/expressions/datetime.op-plus.hand.toml#h003": "matching", @@ -761,11 +761,11 @@ "translation/expressions/math.op-at.toml#t006_boundary_1": "matching", "translation/expressions/math.op-at.toml#t007_boundary_2": "matching_error", "translation/expressions/math.op-at.toml#t008_wrong_kind": "matching_rejection", - "translation/expressions/math.op-bar-bar-slash.toml#t001_types_1": "refused", - "translation/expressions/math.op-bar-bar-slash.toml#t002_null_1": "refused", - "translation/expressions/math.op-bar-bar-slash.toml#t003_boundary_1": "refused", - "translation/expressions/math.op-bar-bar-slash.toml#t004_boundary_2": "refused", - "translation/expressions/math.op-bar-bar-slash.toml#t005_wrong_kind": "refused", + "translation/expressions/math.op-bar-bar-slash.toml#t001_types_1": "matching", + "translation/expressions/math.op-bar-bar-slash.toml#t002_null_1": "matching", + "translation/expressions/math.op-bar-bar-slash.toml#t003_boundary_1": "matching", + "translation/expressions/math.op-bar-bar-slash.toml#t004_boundary_2": "matching", + "translation/expressions/math.op-bar-bar-slash.toml#t005_wrong_kind": "matching_rejection", "translation/expressions/math.op-bar-slash.toml#t001_types_1": "matching_error", "translation/expressions/math.op-bar-slash.toml#t002_null_1": "matching", "translation/expressions/math.op-bar-slash.toml#t003_boundary_1": "matching", @@ -1041,11 +1041,16 @@ "translation/expressions/subquery.some-row.hand.toml#h002": "matching", "translation/expressions/subquery.some.hand.toml#h001": "matching", "translation/expressions/subquery.some.hand.toml#h002": "matching", - "translation/functions/aggregate.any-value.toml#t001_types_1": "refused", - "translation/functions/aggregate.any-value.toml#t002_null_1": "refused", - "translation/functions/aggregate.any-value.toml#t003_boundary_1": "refused", - "translation/functions/aggregate.any-value.toml#t004_boundary_2": "refused", - "translation/functions/aggregate.any-value.toml#t005_wrong_kind": "refused", + "translation/functions/aggregate.any-value.hand.toml#h001": "matching", + "translation/functions/aggregate.any-value.hand.toml#h002": "matching", + "translation/functions/aggregate.any-value.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.any-value.toml#t002_null_1": "matching", + "translation/functions/aggregate.any-value.toml#t003_boundary_1": "matching", + "translation/functions/aggregate.any-value.toml#t004_boundary_2": "matching", + "translation/functions/aggregate.any-value.toml#t005_wrong_kind": "matching", + "translation/functions/aggregate.array-agg-order-by.hand.toml#h001": "matching", + "translation/functions/aggregate.array-agg-order-by.hand.toml#h002": "matching", + "translation/functions/aggregate.array-agg-order-by.hand.toml#h003": "matching", "translation/functions/aggregate.avg.toml#t001_types_1": "refused", "translation/functions/aggregate.avg.toml#t002_types_2": "refused", "translation/functions/aggregate.avg.toml#t003_types_3": "matching", @@ -1122,66 +1127,87 @@ "translation/functions/aggregate.every.toml#t001_types_1": "matching", "translation/functions/aggregate.every.toml#t002_null_1": "matching", "translation/functions/aggregate.every.toml#t003_wrong_kind": "matching_rejection", - "translation/functions/aggregate.json-agg-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.json-agg-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.json-agg-strict.toml#t003_boundary_1": "refused", - "translation/functions/aggregate.json-agg-strict.toml#t004_boundary_2": "refused", - "translation/functions/aggregate.json-agg-strict.toml#t005_wrong_kind": "refused", + "translation/functions/aggregate.json-agg-order-by.hand.toml#h001": "matching", + "translation/functions/aggregate.json-agg-order-by.hand.toml#h002": "matching", + "translation/functions/aggregate.json-agg-order-by.hand.toml#h003": "matching", + "translation/functions/aggregate.json-agg-strict.hand.toml#h001": "matching", + "translation/functions/aggregate.json-agg-strict.hand.toml#h002": "matching", + "translation/functions/aggregate.json-agg-strict.hand.toml#h003": "matching", + "translation/functions/aggregate.json-agg-strict.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.json-agg-strict.toml#t002_null_1": "matching", + "translation/functions/aggregate.json-agg-strict.toml#t003_boundary_1": "matching", + "translation/functions/aggregate.json-agg-strict.toml#t004_boundary_2": "matching", + "translation/functions/aggregate.json-agg-strict.toml#t005_wrong_kind": "matching", "translation/functions/aggregate.json-arrayagg.toml#t001_literal": "matching_rejection", - "translation/functions/aggregate.json-object-agg-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t003_null_2": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.json-object-agg-strict.toml#t008_wrong_kind": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t003_null_2": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.json-object-agg-unique-strict.toml#t008_wrong_kind": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t001_types_1": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t002_null_1": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t003_null_2": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.json-object-agg-unique.toml#t008_wrong_kind": "refused", + "translation/functions/aggregate.json-object-agg-order-by.hand.toml#h001": "matching", + "translation/functions/aggregate.json-object-agg-order-by.hand.toml#h002": "matching", + "translation/functions/aggregate.json-object-agg-order-by.hand.toml#h003": "matching_error", + "translation/functions/aggregate.json-object-agg-strict.hand.toml#h001": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.json-object-agg-strict.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.json-object-agg-strict.toml#t003_null_2": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.json-object-agg-strict.toml#t008_wrong_kind": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.hand.toml#h001": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t003_null_2": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.json-object-agg-unique-strict.toml#t008_wrong_kind": "matching", + "translation/functions/aggregate.json-object-agg-unique.hand.toml#h001": "matching", + "translation/functions/aggregate.json-object-agg-unique.hand.toml#h002": "matching_error", + "translation/functions/aggregate.json-object-agg-unique.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.json-object-agg-unique.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.json-object-agg-unique.toml#t003_null_2": "matching", + "translation/functions/aggregate.json-object-agg-unique.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.json-object-agg-unique.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.json-object-agg-unique.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.json-object-agg-unique.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.json-object-agg-unique.toml#t008_wrong_kind": "matching", "translation/functions/aggregate.json-objectagg.toml#t001_literal": "matching_rejection", - "translation/functions/aggregate.jsonb-agg-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.jsonb-agg-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.jsonb-agg-strict.toml#t003_boundary_1": "refused", - "translation/functions/aggregate.jsonb-agg-strict.toml#t004_boundary_2": "refused", - "translation/functions/aggregate.jsonb-agg-strict.toml#t005_wrong_kind": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t003_null_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.jsonb-object-agg-strict.toml#t008_wrong_kind": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t001_types_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t002_null_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t003_null_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t008_wrong_kind": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t001_types_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t002_null_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t003_null_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.jsonb-object-agg-unique.toml#t008_wrong_kind": "refused", + "translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h001": "matching", + "translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h002": "matching", + "translation/functions/aggregate.jsonb-agg-order-by.hand.toml#h003": "matching", + "translation/functions/aggregate.jsonb-agg-strict.hand.toml#h001": "matching", + "translation/functions/aggregate.jsonb-agg-strict.hand.toml#h002": "matching", + "translation/functions/aggregate.jsonb-agg-strict.hand.toml#h003": "matching", + "translation/functions/aggregate.jsonb-agg-strict.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.jsonb-agg-strict.toml#t002_null_1": "matching", + "translation/functions/aggregate.jsonb-agg-strict.toml#t003_boundary_1": "matching", + "translation/functions/aggregate.jsonb-agg-strict.toml#t004_boundary_2": "matching", + "translation/functions/aggregate.jsonb-agg-strict.toml#t005_wrong_kind": "matching", + "translation/functions/aggregate.jsonb-object-agg-order-by.hand.toml#h001": "matching", + "translation/functions/aggregate.jsonb-object-agg-order-by.hand.toml#h002": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t001_types_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t003_null_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.jsonb-object-agg-strict.toml#t008_wrong_kind": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t001_types_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t003_null_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique-strict.toml#t008_wrong_kind": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t001_types_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t002_null_1": "matching_error", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t003_null_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.jsonb-object-agg-unique.toml#t008_wrong_kind": "matching", "translation/functions/aggregate.max.toml#t001_types_1": "matching", "translation/functions/aggregate.max.toml#t002_null_1": "matching", "translation/functions/aggregate.max.toml#t003_boundary_1": "matching", @@ -1317,14 +1343,16 @@ "translation/functions/aggregate.string-agg-order-by.hand.toml#h001": "matching", "translation/functions/aggregate.string-agg-order-by.hand.toml#h002": "matching", "translation/functions/aggregate.string-agg-order-by.hand.toml#h003": "matching", - "translation/functions/aggregate.string-agg.toml#t001_types_1": "refused", - "translation/functions/aggregate.string-agg.toml#t002_null_1": "refused", - "translation/functions/aggregate.string-agg.toml#t003_null_2": "refused", - "translation/functions/aggregate.string-agg.toml#t004_boundary_1": "refused", - "translation/functions/aggregate.string-agg.toml#t005_boundary_2": "refused", - "translation/functions/aggregate.string-agg.toml#t006_boundary_3": "refused", - "translation/functions/aggregate.string-agg.toml#t007_boundary_4": "refused", - "translation/functions/aggregate.string-agg.toml#t008_wrong_kind": "refused", + "translation/functions/aggregate.string-agg.hand.toml#h001": "matching", + "translation/functions/aggregate.string-agg.hand.toml#h002": "matching", + "translation/functions/aggregate.string-agg.toml#t001_types_1": "declared_divergence", + "translation/functions/aggregate.string-agg.toml#t002_null_1": "matching", + "translation/functions/aggregate.string-agg.toml#t003_null_2": "matching", + "translation/functions/aggregate.string-agg.toml#t004_boundary_1": "matching", + "translation/functions/aggregate.string-agg.toml#t005_boundary_2": "matching", + "translation/functions/aggregate.string-agg.toml#t006_boundary_3": "matching", + "translation/functions/aggregate.string-agg.toml#t007_boundary_4": "matching", + "translation/functions/aggregate.string-agg.toml#t008_wrong_kind": "matching_rejection", "translation/functions/aggregate.sum.toml#t001_types_1": "matching", "translation/functions/aggregate.sum.toml#t002_types_2": "matching", "translation/functions/aggregate.sum.toml#t003_types_3": "matching", @@ -1504,23 +1532,23 @@ "translation/functions/binarystring.btrim.toml#t004_boundary_1": "matching", "translation/functions/binarystring.btrim.toml#t005_boundary_2": "matching", "translation/functions/binarystring.btrim.toml#t006_wrong_kind": "matching_rejection", - "translation/functions/binarystring.convert-from.toml#t001_types_1": "refused", - "translation/functions/binarystring.convert-from.toml#t002_null_1": "refused", - "translation/functions/binarystring.convert-from.toml#t003_null_2": "refused", - "translation/functions/binarystring.convert-from.toml#t004_boundary_1": "refused", - "translation/functions/binarystring.convert-from.toml#t005_wrong_kind": "refused", - "translation/functions/binarystring.convert-to.toml#t001_types_1": "refused", - "translation/functions/binarystring.convert-to.toml#t002_null_1": "refused", - "translation/functions/binarystring.convert-to.toml#t003_null_2": "refused", - "translation/functions/binarystring.convert-to.toml#t004_boundary_1": "refused", - "translation/functions/binarystring.convert-to.toml#t005_boundary_2": "refused", - "translation/functions/binarystring.convert-to.toml#t006_wrong_kind": "refused", - "translation/functions/binarystring.convert.toml#t001_types_1": "refused", - "translation/functions/binarystring.convert.toml#t002_null_1": "refused", - "translation/functions/binarystring.convert.toml#t003_null_2": "refused", - "translation/functions/binarystring.convert.toml#t004_null_3": "refused", - "translation/functions/binarystring.convert.toml#t005_boundary_1": "refused", - "translation/functions/binarystring.convert.toml#t006_wrong_kind": "refused", + "translation/functions/binarystring.convert-from.toml#t001_types_1": "matching_error", + "translation/functions/binarystring.convert-from.toml#t002_null_1": "matching", + "translation/functions/binarystring.convert-from.toml#t003_null_2": "matching", + "translation/functions/binarystring.convert-from.toml#t004_boundary_1": "matching", + "translation/functions/binarystring.convert-from.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/binarystring.convert-to.toml#t001_types_1": "matching", + "translation/functions/binarystring.convert-to.toml#t002_null_1": "matching", + "translation/functions/binarystring.convert-to.toml#t003_null_2": "matching", + "translation/functions/binarystring.convert-to.toml#t004_boundary_1": "matching", + "translation/functions/binarystring.convert-to.toml#t005_boundary_2": "matching_error", + "translation/functions/binarystring.convert-to.toml#t006_wrong_kind": "matching_rejection", + "translation/functions/binarystring.convert.toml#t001_types_1": "matching_error", + "translation/functions/binarystring.convert.toml#t002_null_1": "matching", + "translation/functions/binarystring.convert.toml#t003_null_2": "matching", + "translation/functions/binarystring.convert.toml#t004_null_3": "matching", + "translation/functions/binarystring.convert.toml#t005_boundary_1": "matching", + "translation/functions/binarystring.convert.toml#t006_wrong_kind": "matching_rejection", "translation/functions/binarystring.crc32.toml#t001_types_1": "refused", "translation/functions/binarystring.crc32.toml#t002_null_1": "refused", "translation/functions/binarystring.crc32.toml#t003_boundary_1": "refused", @@ -1685,21 +1713,21 @@ "translation/functions/bitstring.set-bit.toml#t005_boundary_1": "matching_error", "translation/functions/bitstring.set-bit.toml#t006_boundary_2": "matching_error", "translation/functions/bitstring.set-bit.toml#t007_wrong_kind": "matching_rejection", - "translation/functions/bitstring.substring.toml#t001_types_1": "refused", - "translation/functions/bitstring.substring.toml#t002_null_1": "refused", + "translation/functions/bitstring.substring.toml#t001_types_1": "matching_rejection", + "translation/functions/bitstring.substring.toml#t002_null_1": "matching_rejection", "translation/functions/bitstring.substring.toml#t003_wrong_kind": "matching_rejection", - "translation/functions/comparison.num-nonnulls.toml#t001_types_1": "refused", - "translation/functions/comparison.num-nonnulls.toml#t002_types_2": "refused", - "translation/functions/comparison.num-nonnulls.toml#t003_null_1": "refused", - "translation/functions/comparison.num-nonnulls.toml#t004_boundary_1": "refused", - "translation/functions/comparison.num-nonnulls.toml#t005_boundary_2": "refused", - "translation/functions/comparison.num-nonnulls.toml#t006_wrong_kind": "refused", - "translation/functions/comparison.num-nulls.toml#t001_types_1": "refused", - "translation/functions/comparison.num-nulls.toml#t002_types_2": "refused", - "translation/functions/comparison.num-nulls.toml#t003_null_1": "refused", - "translation/functions/comparison.num-nulls.toml#t004_boundary_1": "refused", - "translation/functions/comparison.num-nulls.toml#t005_boundary_2": "refused", - "translation/functions/comparison.num-nulls.toml#t006_wrong_kind": "refused", + "translation/functions/comparison.num-nonnulls.toml#t001_types_1": "matching", + "translation/functions/comparison.num-nonnulls.toml#t002_types_2": "matching", + "translation/functions/comparison.num-nonnulls.toml#t003_null_1": "matching", + "translation/functions/comparison.num-nonnulls.toml#t004_boundary_1": "matching", + "translation/functions/comparison.num-nonnulls.toml#t005_boundary_2": "matching", + "translation/functions/comparison.num-nonnulls.toml#t006_wrong_kind": "matching_rejection", + "translation/functions/comparison.num-nulls.toml#t001_types_1": "matching", + "translation/functions/comparison.num-nulls.toml#t002_types_2": "matching", + "translation/functions/comparison.num-nulls.toml#t003_null_1": "matching", + "translation/functions/comparison.num-nulls.toml#t004_boundary_1": "matching", + "translation/functions/comparison.num-nulls.toml#t005_boundary_2": "matching", + "translation/functions/comparison.num-nulls.toml#t006_wrong_kind": "matching_rejection", "translation/functions/conditional.coalesce.toml#t001_types_1": "matching", "translation/functions/conditional.coalesce.toml#t002_types_2": "matching", "translation/functions/conditional.coalesce.toml#t003_null_1": "matching", @@ -1782,13 +1810,13 @@ "translation/functions/datetime.date-trunc.toml#t007_boundary_3": "matching_error", "translation/functions/datetime.date-trunc.toml#t008_boundary_4": "matching_error", "translation/functions/datetime.date-trunc.toml#t009_wrong_kind": "matching_rejection", - "translation/functions/datetime.extract.toml#t001_types_1": "refused", + "translation/functions/datetime.extract.toml#t001_types_1": "matching", "translation/functions/datetime.extract.toml#t002_types_2": "matching", - "translation/functions/datetime.extract.toml#t003_null_1": "refused", - "translation/functions/datetime.extract.toml#t004_null_2": "refused", - "translation/functions/datetime.extract.toml#t005_boundary_1": "refused", - "translation/functions/datetime.extract.toml#t006_boundary_2": "unrecorded_refused", - "translation/functions/datetime.extract.toml#t007_wrong_kind": "refused", + "translation/functions/datetime.extract.toml#t003_null_1": "matching", + "translation/functions/datetime.extract.toml#t004_null_2": "matching", + "translation/functions/datetime.extract.toml#t005_boundary_1": "matching", + "translation/functions/datetime.extract.toml#t006_boundary_2": "unrecorded_translates", + "translation/functions/datetime.extract.toml#t007_wrong_kind": "matching", "translation/functions/datetime.isfinite.hand.toml#h001": "matching", "translation/functions/datetime.isfinite.toml#t001_types_1": "matching", "translation/functions/datetime.isfinite.toml#t002_types_2": "matching", @@ -2019,10 +2047,10 @@ "translation/functions/json.json-serialize.toml#t004_boundary_1": "matching_rejection", "translation/functions/json.json-serialize.toml#t005_boundary_2": "matching_rejection", "translation/functions/json.json-serialize.toml#t006_wrong_kind": "matching_error", - "translation/functions/json.json-strip-nulls.toml#t001_types_1": "refused", - "translation/functions/json.json-strip-nulls.toml#t002_null_1": "refused", - "translation/functions/json.json-strip-nulls.toml#t003_boundary_1": "refused", - "translation/functions/json.json-strip-nulls.toml#t004_wrong_kind": "refused", + "translation/functions/json.json-strip-nulls.toml#t001_types_1": "matching", + "translation/functions/json.json-strip-nulls.toml#t002_null_1": "matching", + "translation/functions/json.json-strip-nulls.toml#t003_boundary_1": "matching", + "translation/functions/json.json-strip-nulls.toml#t004_wrong_kind": "matching_rejection", "translation/functions/json.json-to-record.toml#t001_types_1": "matching_rejection", "translation/functions/json.json-to-record.toml#t002_null_1": "unrecorded_refused", "translation/functions/json.json-to-record.toml#t003_boundary_1": "matching_rejection", @@ -2184,10 +2212,10 @@ "translation/functions/json.jsonb-populate-recordset.toml#t005_boundary_2": "refused", "translation/functions/json.jsonb-populate-recordset.toml#t006_boundary_3": "refused", "translation/functions/json.jsonb-populate-recordset.toml#t007_wrong_kind": "refused", - "translation/functions/json.jsonb-pretty.toml#t001_types_1": "refused", - "translation/functions/json.jsonb-pretty.toml#t002_null_1": "refused", - "translation/functions/json.jsonb-pretty.toml#t003_boundary_1": "refused", - "translation/functions/json.jsonb-pretty.toml#t004_wrong_kind": "refused", + "translation/functions/json.jsonb-pretty.toml#t001_types_1": "matching", + "translation/functions/json.jsonb-pretty.toml#t002_null_1": "matching", + "translation/functions/json.jsonb-pretty.toml#t003_boundary_1": "matching", + "translation/functions/json.jsonb-pretty.toml#t004_wrong_kind": "matching_rejection", "translation/functions/json.jsonb-set-lax.toml#t001_types_1": "refused", "translation/functions/json.jsonb-set-lax.toml#t002_null_1": "refused", "translation/functions/json.jsonb-set-lax.toml#t003_null_2": "refused", @@ -2202,10 +2230,10 @@ "translation/functions/json.jsonb-set.toml#t005_boundary_1": "refused", "translation/functions/json.jsonb-set.toml#t006_boundary_2": "refused", "translation/functions/json.jsonb-set.toml#t007_wrong_kind": "refused", - "translation/functions/json.jsonb-strip-nulls.toml#t001_types_1": "refused", - "translation/functions/json.jsonb-strip-nulls.toml#t002_null_1": "refused", - "translation/functions/json.jsonb-strip-nulls.toml#t003_boundary_1": "refused", - "translation/functions/json.jsonb-strip-nulls.toml#t004_wrong_kind": "refused", + "translation/functions/json.jsonb-strip-nulls.toml#t001_types_1": "matching", + "translation/functions/json.jsonb-strip-nulls.toml#t002_null_1": "matching", + "translation/functions/json.jsonb-strip-nulls.toml#t003_boundary_1": "matching", + "translation/functions/json.jsonb-strip-nulls.toml#t004_wrong_kind": "matching_rejection", "translation/functions/json.jsonb-to-record.toml#t001_types_1": "matching_rejection", "translation/functions/json.jsonb-to-record.toml#t002_null_1": "unrecorded_refused", "translation/functions/json.jsonb-to-record.toml#t003_boundary_1": "matching_rejection", @@ -2231,15 +2259,15 @@ "translation/functions/json.to-jsonb.toml#t003_boundary_1": "matching", "translation/functions/json.to-jsonb.toml#t004_boundary_2": "matching", "translation/functions/json.to-jsonb.toml#t005_wrong_kind": "matching", - "translation/functions/matching.substring.toml#t001_types_1": "refused", - "translation/functions/matching.substring.toml#t002_null_1": "refused", - "translation/functions/matching.substring.toml#t003_null_2": "refused", - "translation/functions/matching.substring.toml#t004_null_3": "refused", - "translation/functions/matching.substring.toml#t005_boundary_1": "refused", - "translation/functions/matching.substring.toml#t006_boundary_2": "refused", - "translation/functions/matching.substring.toml#t007_boundary_3": "refused", - "translation/functions/matching.substring.toml#t008_boundary_4": "refused", - "translation/functions/matching.substring.toml#t009_wrong_kind": "refused", + "translation/functions/matching.substring.toml#t001_types_1": "matching_error", + "translation/functions/matching.substring.toml#t002_null_1": "matching", + "translation/functions/matching.substring.toml#t003_null_2": "matching", + "translation/functions/matching.substring.toml#t004_null_3": "matching", + "translation/functions/matching.substring.toml#t005_boundary_1": "matching_error", + "translation/functions/matching.substring.toml#t006_boundary_2": "matching_error", + "translation/functions/matching.substring.toml#t007_boundary_3": "matching_error", + "translation/functions/matching.substring.toml#t008_boundary_4": "matching_error", + "translation/functions/matching.substring.toml#t009_wrong_kind": "matching_rejection", "translation/functions/math.abs.toml#t001_types_1": "matching", "translation/functions/math.abs.toml#t002_types_2": "matching", "translation/functions/math.abs.toml#t003_types_3": "matching", @@ -2248,72 +2276,72 @@ "translation/functions/math.abs.toml#t006_boundary_1": "matching", "translation/functions/math.abs.toml#t007_boundary_2": "matching_error", "translation/functions/math.abs.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/math.acos.toml#t001_types_1": "refused", - "translation/functions/math.acos.toml#t002_null_1": "refused", - "translation/functions/math.acos.toml#t003_boundary_1": "refused", - "translation/functions/math.acos.toml#t004_boundary_2": "refused", - "translation/functions/math.acos.toml#t005_wrong_kind": "refused", - "translation/functions/math.acosd.toml#t001_types_1": "refused", - "translation/functions/math.acosd.toml#t002_null_1": "refused", - "translation/functions/math.acosd.toml#t003_boundary_1": "refused", - "translation/functions/math.acosd.toml#t004_boundary_2": "refused", - "translation/functions/math.acosd.toml#t005_wrong_kind": "refused", - "translation/functions/math.acosh.toml#t001_types_1": "refused", - "translation/functions/math.acosh.toml#t002_null_1": "refused", - "translation/functions/math.acosh.toml#t003_boundary_1": "refused", - "translation/functions/math.acosh.toml#t004_boundary_2": "refused", - "translation/functions/math.acosh.toml#t005_wrong_kind": "refused", - "translation/functions/math.asin.toml#t001_types_1": "refused", - "translation/functions/math.asin.toml#t002_null_1": "refused", - "translation/functions/math.asin.toml#t003_boundary_1": "refused", - "translation/functions/math.asin.toml#t004_boundary_2": "refused", - "translation/functions/math.asin.toml#t005_wrong_kind": "refused", - "translation/functions/math.asind.toml#t001_types_1": "refused", - "translation/functions/math.asind.toml#t002_null_1": "refused", - "translation/functions/math.asind.toml#t003_boundary_1": "refused", - "translation/functions/math.asind.toml#t004_boundary_2": "refused", - "translation/functions/math.asind.toml#t005_wrong_kind": "refused", - "translation/functions/math.asinh.toml#t001_types_1": "refused", - "translation/functions/math.asinh.toml#t002_null_1": "refused", - "translation/functions/math.asinh.toml#t003_boundary_1": "refused", - "translation/functions/math.asinh.toml#t004_boundary_2": "refused", - "translation/functions/math.asinh.toml#t005_wrong_kind": "refused", - "translation/functions/math.atan.toml#t001_types_1": "refused", - "translation/functions/math.atan.toml#t002_null_1": "refused", - "translation/functions/math.atan.toml#t003_boundary_1": "refused", - "translation/functions/math.atan.toml#t004_boundary_2": "refused", - "translation/functions/math.atan.toml#t005_wrong_kind": "refused", - "translation/functions/math.atan2.toml#t001_types_1": "refused", - "translation/functions/math.atan2.toml#t002_null_1": "refused", - "translation/functions/math.atan2.toml#t003_null_2": "refused", - "translation/functions/math.atan2.toml#t004_boundary_1": "refused", - "translation/functions/math.atan2.toml#t005_boundary_2": "refused", - "translation/functions/math.atan2.toml#t006_boundary_3": "refused", - "translation/functions/math.atan2.toml#t007_boundary_4": "refused", - "translation/functions/math.atan2.toml#t008_wrong_kind": "refused", - "translation/functions/math.atan2d.toml#t001_types_1": "refused", - "translation/functions/math.atan2d.toml#t002_null_1": "refused", - "translation/functions/math.atan2d.toml#t003_null_2": "refused", - "translation/functions/math.atan2d.toml#t004_boundary_1": "refused", - "translation/functions/math.atan2d.toml#t005_boundary_2": "refused", - "translation/functions/math.atan2d.toml#t006_boundary_3": "refused", - "translation/functions/math.atan2d.toml#t007_boundary_4": "refused", - "translation/functions/math.atan2d.toml#t008_wrong_kind": "refused", - "translation/functions/math.atand.toml#t001_types_1": "refused", - "translation/functions/math.atand.toml#t002_null_1": "refused", - "translation/functions/math.atand.toml#t003_boundary_1": "refused", - "translation/functions/math.atand.toml#t004_boundary_2": "refused", - "translation/functions/math.atand.toml#t005_wrong_kind": "refused", - "translation/functions/math.atanh.toml#t001_types_1": "refused", - "translation/functions/math.atanh.toml#t002_null_1": "refused", - "translation/functions/math.atanh.toml#t003_boundary_1": "refused", - "translation/functions/math.atanh.toml#t004_boundary_2": "refused", - "translation/functions/math.atanh.toml#t005_wrong_kind": "refused", - "translation/functions/math.cbrt.toml#t001_types_1": "refused", - "translation/functions/math.cbrt.toml#t002_null_1": "refused", - "translation/functions/math.cbrt.toml#t003_boundary_1": "refused", - "translation/functions/math.cbrt.toml#t004_boundary_2": "refused", - "translation/functions/math.cbrt.toml#t005_wrong_kind": "refused", + "translation/functions/math.acos.toml#t001_types_1": "matching_error", + "translation/functions/math.acos.toml#t002_null_1": "matching", + "translation/functions/math.acos.toml#t003_boundary_1": "matching", + "translation/functions/math.acos.toml#t004_boundary_2": "matching_error", + "translation/functions/math.acos.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.acosd.toml#t001_types_1": "matching_error", + "translation/functions/math.acosd.toml#t002_null_1": "matching", + "translation/functions/math.acosd.toml#t003_boundary_1": "matching", + "translation/functions/math.acosd.toml#t004_boundary_2": "matching_error", + "translation/functions/math.acosd.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.acosh.toml#t001_types_1": "matching_error", + "translation/functions/math.acosh.toml#t002_null_1": "matching", + "translation/functions/math.acosh.toml#t003_boundary_1": "matching", + "translation/functions/math.acosh.toml#t004_boundary_2": "matching", + "translation/functions/math.acosh.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.asin.toml#t001_types_1": "matching_error", + "translation/functions/math.asin.toml#t002_null_1": "matching", + "translation/functions/math.asin.toml#t003_boundary_1": "matching", + "translation/functions/math.asin.toml#t004_boundary_2": "matching_error", + "translation/functions/math.asin.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.asind.toml#t001_types_1": "matching_error", + "translation/functions/math.asind.toml#t002_null_1": "matching", + "translation/functions/math.asind.toml#t003_boundary_1": "matching", + "translation/functions/math.asind.toml#t004_boundary_2": "matching_error", + "translation/functions/math.asind.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.asinh.toml#t001_types_1": "matching", + "translation/functions/math.asinh.toml#t002_null_1": "matching", + "translation/functions/math.asinh.toml#t003_boundary_1": "matching", + "translation/functions/math.asinh.toml#t004_boundary_2": "matching", + "translation/functions/math.asinh.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.atan.toml#t001_types_1": "matching", + "translation/functions/math.atan.toml#t002_null_1": "matching", + "translation/functions/math.atan.toml#t003_boundary_1": "matching", + "translation/functions/math.atan.toml#t004_boundary_2": "matching", + "translation/functions/math.atan.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.atan2.toml#t001_types_1": "matching", + "translation/functions/math.atan2.toml#t002_null_1": "matching", + "translation/functions/math.atan2.toml#t003_null_2": "matching", + "translation/functions/math.atan2.toml#t004_boundary_1": "matching", + "translation/functions/math.atan2.toml#t005_boundary_2": "matching", + "translation/functions/math.atan2.toml#t006_boundary_3": "matching", + "translation/functions/math.atan2.toml#t007_boundary_4": "matching", + "translation/functions/math.atan2.toml#t008_wrong_kind": "matching_rejection", + "translation/functions/math.atan2d.toml#t001_types_1": "matching", + "translation/functions/math.atan2d.toml#t002_null_1": "matching", + "translation/functions/math.atan2d.toml#t003_null_2": "matching", + "translation/functions/math.atan2d.toml#t004_boundary_1": "matching", + "translation/functions/math.atan2d.toml#t005_boundary_2": "matching", + "translation/functions/math.atan2d.toml#t006_boundary_3": "matching", + "translation/functions/math.atan2d.toml#t007_boundary_4": "matching", + "translation/functions/math.atan2d.toml#t008_wrong_kind": "matching_rejection", + "translation/functions/math.atand.toml#t001_types_1": "matching", + "translation/functions/math.atand.toml#t002_null_1": "matching", + "translation/functions/math.atand.toml#t003_boundary_1": "matching", + "translation/functions/math.atand.toml#t004_boundary_2": "matching", + "translation/functions/math.atand.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.atanh.toml#t001_types_1": "matching_error", + "translation/functions/math.atanh.toml#t002_null_1": "matching", + "translation/functions/math.atanh.toml#t003_boundary_1": "matching", + "translation/functions/math.atanh.toml#t004_boundary_2": "matching_error", + "translation/functions/math.atanh.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.cbrt.toml#t001_types_1": "matching", + "translation/functions/math.cbrt.toml#t002_null_1": "matching", + "translation/functions/math.cbrt.toml#t003_boundary_1": "matching", + "translation/functions/math.cbrt.toml#t004_boundary_2": "matching", + "translation/functions/math.cbrt.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.ceil.toml#t001_types_1": "matching", "translation/functions/math.ceil.toml#t002_types_2": "matching", "translation/functions/math.ceil.toml#t003_null_1": "matching", @@ -2326,44 +2354,44 @@ "translation/functions/math.ceiling.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.ceiling.toml#t005_boundary_2": "refused", "translation/functions/math.ceiling.toml#t006_wrong_kind": "matching_rejection", - "translation/functions/math.cos.toml#t001_types_1": "refused", - "translation/functions/math.cos.toml#t002_null_1": "refused", - "translation/functions/math.cos.toml#t003_boundary_1": "refused", - "translation/functions/math.cos.toml#t004_boundary_2": "refused", - "translation/functions/math.cos.toml#t005_wrong_kind": "refused", - "translation/functions/math.cosd.toml#t001_types_1": "refused", - "translation/functions/math.cosd.toml#t002_null_1": "refused", - "translation/functions/math.cosd.toml#t003_boundary_1": "refused", - "translation/functions/math.cosd.toml#t004_boundary_2": "refused", - "translation/functions/math.cosd.toml#t005_wrong_kind": "refused", - "translation/functions/math.cosh.toml#t001_types_1": "refused", - "translation/functions/math.cosh.toml#t002_null_1": "refused", - "translation/functions/math.cosh.toml#t003_boundary_1": "refused", - "translation/functions/math.cosh.toml#t004_boundary_2": "refused", - "translation/functions/math.cosh.toml#t005_wrong_kind": "refused", - "translation/functions/math.cot.toml#t001_types_1": "refused", - "translation/functions/math.cot.toml#t002_null_1": "refused", - "translation/functions/math.cot.toml#t003_boundary_1": "refused", - "translation/functions/math.cot.toml#t004_boundary_2": "refused", - "translation/functions/math.cot.toml#t005_wrong_kind": "refused", - "translation/functions/math.cotd.toml#t001_types_1": "refused", - "translation/functions/math.cotd.toml#t002_null_1": "refused", - "translation/functions/math.cotd.toml#t003_boundary_1": "refused", - "translation/functions/math.cotd.toml#t004_boundary_2": "refused", - "translation/functions/math.cotd.toml#t005_wrong_kind": "refused", + "translation/functions/math.cos.toml#t001_types_1": "matching", + "translation/functions/math.cos.toml#t002_null_1": "matching", + "translation/functions/math.cos.toml#t003_boundary_1": "matching", + "translation/functions/math.cos.toml#t004_boundary_2": "matching_error", + "translation/functions/math.cos.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.cosd.toml#t001_types_1": "matching", + "translation/functions/math.cosd.toml#t002_null_1": "matching", + "translation/functions/math.cosd.toml#t003_boundary_1": "matching", + "translation/functions/math.cosd.toml#t004_boundary_2": "matching_error", + "translation/functions/math.cosd.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.cosh.toml#t001_types_1": "matching", + "translation/functions/math.cosh.toml#t002_null_1": "matching", + "translation/functions/math.cosh.toml#t003_boundary_1": "matching", + "translation/functions/math.cosh.toml#t004_boundary_2": "matching", + "translation/functions/math.cosh.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.cot.toml#t001_types_1": "matching", + "translation/functions/math.cot.toml#t002_null_1": "matching", + "translation/functions/math.cot.toml#t003_boundary_1": "matching", + "translation/functions/math.cot.toml#t004_boundary_2": "matching_error", + "translation/functions/math.cot.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.cotd.toml#t001_types_1": "matching", + "translation/functions/math.cotd.toml#t002_null_1": "matching", + "translation/functions/math.cotd.toml#t003_boundary_1": "matching", + "translation/functions/math.cotd.toml#t004_boundary_2": "matching_error", + "translation/functions/math.cotd.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.degrees.toml#t001_types_1": "matching", "translation/functions/math.degrees.toml#t002_null_1": "matching", "translation/functions/math.degrees.toml#t003_boundary_1": "matching", "translation/functions/math.degrees.toml#t004_boundary_2": "matching", "translation/functions/math.degrees.toml#t005_wrong_kind": "matching_rejection", - "translation/functions/math.div.toml#t001_types_1": "refused", - "translation/functions/math.div.toml#t002_null_1": "refused", - "translation/functions/math.div.toml#t003_null_2": "refused", + "translation/functions/math.div.toml#t001_types_1": "matching", + "translation/functions/math.div.toml#t002_null_1": "matching", + "translation/functions/math.div.toml#t003_null_2": "matching", "translation/functions/math.div.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.div.toml#t005_boundary_2": "refused", "translation/functions/math.div.toml#t006_boundary_3": "unrecorded_refused", "translation/functions/math.div.toml#t007_boundary_4": "refused", - "translation/functions/math.div.toml#t008_wrong_kind": "refused", + "translation/functions/math.div.toml#t008_wrong_kind": "matching_rejection", "translation/functions/math.erf.toml#t001_types_1": "refused", "translation/functions/math.erf.toml#t002_null_1": "refused", "translation/functions/math.erf.toml#t003_boundary_1": "refused", @@ -2375,7 +2403,7 @@ "translation/functions/math.erfc.toml#t004_boundary_2": "refused", "translation/functions/math.erfc.toml#t005_wrong_kind": "refused", "translation/functions/math.exp.toml#t001_types_1": "refused", - "translation/functions/math.exp.toml#t002_types_2": "refused", + "translation/functions/math.exp.toml#t002_types_2": "matching", "translation/functions/math.exp.toml#t003_null_1": "refused", "translation/functions/math.exp.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.exp.toml#t005_boundary_2": "refused", @@ -2391,11 +2419,11 @@ "translation/functions/math.floor.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.floor.toml#t005_boundary_2": "refused", "translation/functions/math.floor.toml#t006_wrong_kind": "matching_rejection", - "translation/functions/math.gamma.toml#t001_types_1": "refused", - "translation/functions/math.gamma.toml#t002_null_1": "refused", - "translation/functions/math.gamma.toml#t003_boundary_1": "refused", - "translation/functions/math.gamma.toml#t004_boundary_2": "refused", - "translation/functions/math.gamma.toml#t005_wrong_kind": "refused", + "translation/functions/math.gamma.toml#t001_types_1": "matching_error", + "translation/functions/math.gamma.toml#t002_null_1": "matching", + "translation/functions/math.gamma.toml#t003_boundary_1": "matching", + "translation/functions/math.gamma.toml#t004_boundary_2": "matching", + "translation/functions/math.gamma.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.gcd.toml#t001_types_1": "matching", "translation/functions/math.gcd.toml#t002_types_2": "matching", "translation/functions/math.gcd.toml#t003_types_3": "matching", @@ -2416,25 +2444,25 @@ "translation/functions/math.lcm.toml#t008_boundary_3": "matching_error", "translation/functions/math.lcm.toml#t009_boundary_4": "matching_error", "translation/functions/math.lcm.toml#t010_wrong_kind": "matching_rejection", - "translation/functions/math.lgamma.toml#t001_types_1": "refused", - "translation/functions/math.lgamma.toml#t002_null_1": "refused", - "translation/functions/math.lgamma.toml#t003_boundary_1": "refused", - "translation/functions/math.lgamma.toml#t004_boundary_2": "refused", - "translation/functions/math.lgamma.toml#t005_wrong_kind": "refused", + "translation/functions/math.lgamma.toml#t001_types_1": "matching_error", + "translation/functions/math.lgamma.toml#t002_null_1": "matching", + "translation/functions/math.lgamma.toml#t003_boundary_1": "matching", + "translation/functions/math.lgamma.toml#t004_boundary_2": "matching", + "translation/functions/math.lgamma.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.ln.toml#t001_types_1": "refused", - "translation/functions/math.ln.toml#t002_types_2": "refused", + "translation/functions/math.ln.toml#t002_types_2": "matching_error", "translation/functions/math.ln.toml#t003_null_1": "refused", "translation/functions/math.ln.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.ln.toml#t005_boundary_2": "refused", "translation/functions/math.ln.toml#t006_wrong_kind": "refused", "translation/functions/math.log.toml#t001_types_1": "refused", - "translation/functions/math.log.toml#t002_types_2": "refused", + "translation/functions/math.log.toml#t002_types_2": "matching_error", "translation/functions/math.log.toml#t003_null_1": "refused", "translation/functions/math.log.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.log.toml#t005_boundary_2": "refused", "translation/functions/math.log.toml#t006_wrong_kind": "refused", "translation/functions/math.log10.toml#t001_types_1": "refused", - "translation/functions/math.log10.toml#t002_types_2": "refused", + "translation/functions/math.log10.toml#t002_types_2": "matching_error", "translation/functions/math.log10.toml#t003_null_1": "refused", "translation/functions/math.log10.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.log10.toml#t005_boundary_2": "refused", @@ -2456,7 +2484,7 @@ "translation/functions/math.mod.toml#t010_wrong_kind": "matching_rejection", "translation/functions/math.pi.toml#t001_literal": "matching", "translation/functions/math.power.toml#t001_types_1": "refused", - "translation/functions/math.power.toml#t002_types_2": "refused", + "translation/functions/math.power.toml#t002_types_2": "matching_error", "translation/functions/math.power.toml#t003_null_1": "refused", "translation/functions/math.power.toml#t004_null_2": "refused", "translation/functions/math.power.toml#t005_boundary_1": "unrecorded_refused", @@ -2486,42 +2514,42 @@ "translation/functions/math.sign.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.sign.toml#t005_boundary_2": "refused", "translation/functions/math.sign.toml#t006_wrong_kind": "matching_rejection", - "translation/functions/math.sin.toml#t001_types_1": "refused", - "translation/functions/math.sin.toml#t002_null_1": "refused", - "translation/functions/math.sin.toml#t003_boundary_1": "refused", - "translation/functions/math.sin.toml#t004_boundary_2": "refused", - "translation/functions/math.sin.toml#t005_wrong_kind": "refused", - "translation/functions/math.sind.toml#t001_types_1": "refused", - "translation/functions/math.sind.toml#t002_null_1": "refused", - "translation/functions/math.sind.toml#t003_boundary_1": "refused", - "translation/functions/math.sind.toml#t004_boundary_2": "refused", - "translation/functions/math.sind.toml#t005_wrong_kind": "refused", - "translation/functions/math.sinh.toml#t001_types_1": "refused", - "translation/functions/math.sinh.toml#t002_null_1": "refused", - "translation/functions/math.sinh.toml#t003_boundary_1": "refused", - "translation/functions/math.sinh.toml#t004_boundary_2": "refused", - "translation/functions/math.sinh.toml#t005_wrong_kind": "refused", + "translation/functions/math.sin.toml#t001_types_1": "matching", + "translation/functions/math.sin.toml#t002_null_1": "matching", + "translation/functions/math.sin.toml#t003_boundary_1": "matching", + "translation/functions/math.sin.toml#t004_boundary_2": "matching_error", + "translation/functions/math.sin.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.sind.toml#t001_types_1": "matching", + "translation/functions/math.sind.toml#t002_null_1": "matching", + "translation/functions/math.sind.toml#t003_boundary_1": "matching", + "translation/functions/math.sind.toml#t004_boundary_2": "matching_error", + "translation/functions/math.sind.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.sinh.toml#t001_types_1": "matching", + "translation/functions/math.sinh.toml#t002_null_1": "matching", + "translation/functions/math.sinh.toml#t003_boundary_1": "matching", + "translation/functions/math.sinh.toml#t004_boundary_2": "matching", + "translation/functions/math.sinh.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.sqrt.toml#t001_types_1": "refused", "translation/functions/math.sqrt.toml#t002_types_2": "matching_error", "translation/functions/math.sqrt.toml#t003_null_1": "refused", "translation/functions/math.sqrt.toml#t004_boundary_1": "unrecorded_refused", "translation/functions/math.sqrt.toml#t005_boundary_2": "refused", "translation/functions/math.sqrt.toml#t006_wrong_kind": "refused", - "translation/functions/math.tan.toml#t001_types_1": "refused", - "translation/functions/math.tan.toml#t002_null_1": "refused", - "translation/functions/math.tan.toml#t003_boundary_1": "refused", - "translation/functions/math.tan.toml#t004_boundary_2": "refused", - "translation/functions/math.tan.toml#t005_wrong_kind": "refused", - "translation/functions/math.tand.toml#t001_types_1": "refused", - "translation/functions/math.tand.toml#t002_null_1": "refused", - "translation/functions/math.tand.toml#t003_boundary_1": "refused", - "translation/functions/math.tand.toml#t004_boundary_2": "refused", - "translation/functions/math.tand.toml#t005_wrong_kind": "refused", - "translation/functions/math.tanh.toml#t001_types_1": "refused", - "translation/functions/math.tanh.toml#t002_null_1": "refused", - "translation/functions/math.tanh.toml#t003_boundary_1": "refused", - "translation/functions/math.tanh.toml#t004_boundary_2": "refused", - "translation/functions/math.tanh.toml#t005_wrong_kind": "refused", + "translation/functions/math.tan.toml#t001_types_1": "matching", + "translation/functions/math.tan.toml#t002_null_1": "matching", + "translation/functions/math.tan.toml#t003_boundary_1": "matching", + "translation/functions/math.tan.toml#t004_boundary_2": "matching_error", + "translation/functions/math.tan.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.tand.toml#t001_types_1": "matching", + "translation/functions/math.tand.toml#t002_null_1": "matching", + "translation/functions/math.tand.toml#t003_boundary_1": "matching", + "translation/functions/math.tand.toml#t004_boundary_2": "matching_error", + "translation/functions/math.tand.toml#t005_wrong_kind": "matching_rejection", + "translation/functions/math.tanh.toml#t001_types_1": "matching", + "translation/functions/math.tanh.toml#t002_null_1": "matching", + "translation/functions/math.tanh.toml#t003_boundary_1": "matching", + "translation/functions/math.tanh.toml#t004_boundary_2": "matching", + "translation/functions/math.tanh.toml#t005_wrong_kind": "matching_rejection", "translation/functions/math.trim-scale.toml#t001_types_1": "refused", "translation/functions/math.trim-scale.toml#t002_null_1": "refused", "translation/functions/math.trim-scale.toml#t003_boundary_1": "unrecorded_refused", @@ -2672,11 +2700,11 @@ "translation/functions/string.overlay-placing-from.toml#t007_boundary_3": "matching_error", "translation/functions/string.overlay-placing-from.toml#t008_boundary_4": "matching_error", "translation/functions/string.overlay-placing-from.toml#t009_wrong_kind": "matching_rejection", - "translation/functions/string.parse-ident.toml#t001_types_1": "refused", - "translation/functions/string.parse-ident.toml#t002_null_1": "refused", - "translation/functions/string.parse-ident.toml#t003_boundary_1": "refused", - "translation/functions/string.parse-ident.toml#t004_boundary_2": "refused", - "translation/functions/string.parse-ident.toml#t005_wrong_kind": "refused", + "translation/functions/string.parse-ident.toml#t001_types_1": "matching_error", + "translation/functions/string.parse-ident.toml#t002_null_1": "matching", + "translation/functions/string.parse-ident.toml#t003_boundary_1": "matching_error", + "translation/functions/string.parse-ident.toml#t004_boundary_2": "matching_error", + "translation/functions/string.parse-ident.toml#t005_wrong_kind": "matching_rejection", "translation/functions/string.position-in.toml#t001_types_1": "matching", "translation/functions/string.position-in.toml#t002_null_1": "matching", "translation/functions/string.position-in.toml#t003_null_2": "matching", @@ -2685,11 +2713,11 @@ "translation/functions/string.position-in.toml#t006_boundary_3": "matching", "translation/functions/string.position-in.toml#t007_boundary_4": "matching", "translation/functions/string.position-in.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/string.quote-ident.toml#t001_types_1": "refused", - "translation/functions/string.quote-ident.toml#t002_null_1": "refused", - "translation/functions/string.quote-ident.toml#t003_boundary_1": "refused", - "translation/functions/string.quote-ident.toml#t004_boundary_2": "refused", - "translation/functions/string.quote-ident.toml#t005_wrong_kind": "refused", + "translation/functions/string.quote-ident.toml#t001_types_1": "matching", + "translation/functions/string.quote-ident.toml#t002_null_1": "matching", + "translation/functions/string.quote-ident.toml#t003_boundary_1": "matching", + "translation/functions/string.quote-ident.toml#t004_boundary_2": "matching", + "translation/functions/string.quote-ident.toml#t005_wrong_kind": "matching_rejection", "translation/functions/string.quote-literal.toml#t001_types_1": "matching", "translation/functions/string.quote-literal.toml#t002_types_2": "matching", "translation/functions/string.quote-literal.toml#t003_null_1": "matching", @@ -2726,22 +2754,22 @@ "translation/functions/string.regexp-like.toml#t006_boundary_3": "matching", "translation/functions/string.regexp-like.toml#t007_boundary_4": "matching", "translation/functions/string.regexp-like.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/string.regexp-match.toml#t001_types_1": "refused", - "translation/functions/string.regexp-match.toml#t002_null_1": "refused", - "translation/functions/string.regexp-match.toml#t003_null_2": "refused", - "translation/functions/string.regexp-match.toml#t004_boundary_1": "refused", - "translation/functions/string.regexp-match.toml#t005_boundary_2": "refused", - "translation/functions/string.regexp-match.toml#t006_boundary_3": "refused", - "translation/functions/string.regexp-match.toml#t007_boundary_4": "refused", - "translation/functions/string.regexp-match.toml#t008_wrong_kind": "refused", - "translation/functions/string.regexp-matches.toml#t001_types_1": "refused", - "translation/functions/string.regexp-matches.toml#t002_null_1": "refused", - "translation/functions/string.regexp-matches.toml#t003_null_2": "refused", - "translation/functions/string.regexp-matches.toml#t004_boundary_1": "refused", - "translation/functions/string.regexp-matches.toml#t005_boundary_2": "refused", - "translation/functions/string.regexp-matches.toml#t006_boundary_3": "refused", - "translation/functions/string.regexp-matches.toml#t007_boundary_4": "refused", - "translation/functions/string.regexp-matches.toml#t008_wrong_kind": "refused", + "translation/functions/string.regexp-match.toml#t001_types_1": "matching", + "translation/functions/string.regexp-match.toml#t002_null_1": "matching", + "translation/functions/string.regexp-match.toml#t003_null_2": "matching", + "translation/functions/string.regexp-match.toml#t004_boundary_1": "matching", + "translation/functions/string.regexp-match.toml#t005_boundary_2": "matching", + "translation/functions/string.regexp-match.toml#t006_boundary_3": "matching", + "translation/functions/string.regexp-match.toml#t007_boundary_4": "matching", + "translation/functions/string.regexp-match.toml#t008_wrong_kind": "matching_rejection", + "translation/functions/string.regexp-matches.toml#t001_types_1": "matching", + "translation/functions/string.regexp-matches.toml#t002_null_1": "matching", + "translation/functions/string.regexp-matches.toml#t003_null_2": "matching", + "translation/functions/string.regexp-matches.toml#t004_boundary_1": "matching", + "translation/functions/string.regexp-matches.toml#t005_boundary_2": "matching", + "translation/functions/string.regexp-matches.toml#t006_boundary_3": "matching", + "translation/functions/string.regexp-matches.toml#t007_boundary_4": "matching", + "translation/functions/string.regexp-matches.toml#t008_wrong_kind": "matching_rejection", "translation/functions/string.regexp-replace.toml#t001_types_1": "matching", "translation/functions/string.regexp-replace.toml#t002_null_1": "matching", "translation/functions/string.regexp-replace.toml#t003_null_2": "matching", @@ -2751,22 +2779,22 @@ "translation/functions/string.regexp-replace.toml#t007_boundary_3": "matching", "translation/functions/string.regexp-replace.toml#t008_boundary_4": "matching", "translation/functions/string.regexp-replace.toml#t009_wrong_kind": "matching_rejection", - "translation/functions/string.regexp-split-to-array.toml#t001_types_1": "refused", - "translation/functions/string.regexp-split-to-array.toml#t002_null_1": "refused", - "translation/functions/string.regexp-split-to-array.toml#t003_null_2": "refused", - "translation/functions/string.regexp-split-to-array.toml#t004_boundary_1": "refused", - "translation/functions/string.regexp-split-to-array.toml#t005_boundary_2": "refused", - "translation/functions/string.regexp-split-to-array.toml#t006_boundary_3": "refused", - "translation/functions/string.regexp-split-to-array.toml#t007_boundary_4": "refused", - "translation/functions/string.regexp-split-to-array.toml#t008_wrong_kind": "refused", - "translation/functions/string.regexp-split-to-table.toml#t001_types_1": "refused", - "translation/functions/string.regexp-split-to-table.toml#t002_null_1": "refused", - "translation/functions/string.regexp-split-to-table.toml#t003_null_2": "refused", - "translation/functions/string.regexp-split-to-table.toml#t004_boundary_1": "refused", - "translation/functions/string.regexp-split-to-table.toml#t005_boundary_2": "refused", - "translation/functions/string.regexp-split-to-table.toml#t006_boundary_3": "refused", - "translation/functions/string.regexp-split-to-table.toml#t007_boundary_4": "refused", - "translation/functions/string.regexp-split-to-table.toml#t008_wrong_kind": "refused", + "translation/functions/string.regexp-split-to-array.toml#t001_types_1": "matching", + "translation/functions/string.regexp-split-to-array.toml#t002_null_1": "matching", + "translation/functions/string.regexp-split-to-array.toml#t003_null_2": "matching", + "translation/functions/string.regexp-split-to-array.toml#t004_boundary_1": "matching", + "translation/functions/string.regexp-split-to-array.toml#t005_boundary_2": "matching", + "translation/functions/string.regexp-split-to-array.toml#t006_boundary_3": "matching", + "translation/functions/string.regexp-split-to-array.toml#t007_boundary_4": "matching", + "translation/functions/string.regexp-split-to-array.toml#t008_wrong_kind": "matching_rejection", + "translation/functions/string.regexp-split-to-table.toml#t001_types_1": "matching", + "translation/functions/string.regexp-split-to-table.toml#t002_null_1": "matching", + "translation/functions/string.regexp-split-to-table.toml#t003_null_2": "matching", + "translation/functions/string.regexp-split-to-table.toml#t004_boundary_1": "matching", + "translation/functions/string.regexp-split-to-table.toml#t005_boundary_2": "matching", + "translation/functions/string.regexp-split-to-table.toml#t006_boundary_3": "matching", + "translation/functions/string.regexp-split-to-table.toml#t007_boundary_4": "matching", + "translation/functions/string.regexp-split-to-table.toml#t008_wrong_kind": "matching_rejection", "translation/functions/string.regexp-substr.toml#t001_types_1": "matching", "translation/functions/string.regexp-substr.toml#t002_null_1": "matching", "translation/functions/string.regexp-substr.toml#t003_null_2": "matching", @@ -2831,22 +2859,22 @@ "translation/functions/string.starts-with.toml#t006_boundary_3": "matching", "translation/functions/string.starts-with.toml#t007_boundary_4": "matching", "translation/functions/string.starts-with.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/string.string-to-array.toml#t001_types_1": "refused", - "translation/functions/string.string-to-array.toml#t002_null_1": "refused", - "translation/functions/string.string-to-array.toml#t003_null_2": "refused", - "translation/functions/string.string-to-array.toml#t004_boundary_1": "refused", - "translation/functions/string.string-to-array.toml#t005_boundary_2": "refused", - "translation/functions/string.string-to-array.toml#t006_boundary_3": "refused", - "translation/functions/string.string-to-array.toml#t007_boundary_4": "refused", - "translation/functions/string.string-to-array.toml#t008_wrong_kind": "refused", - "translation/functions/string.string-to-table.toml#t001_types_1": "refused", - "translation/functions/string.string-to-table.toml#t002_null_1": "refused", - "translation/functions/string.string-to-table.toml#t003_null_2": "refused", - "translation/functions/string.string-to-table.toml#t004_boundary_1": "refused", - "translation/functions/string.string-to-table.toml#t005_boundary_2": "refused", - "translation/functions/string.string-to-table.toml#t006_boundary_3": "refused", - "translation/functions/string.string-to-table.toml#t007_boundary_4": "refused", - "translation/functions/string.string-to-table.toml#t008_wrong_kind": "refused", + "translation/functions/string.string-to-array.toml#t001_types_1": "matching", + "translation/functions/string.string-to-array.toml#t002_null_1": "matching", + "translation/functions/string.string-to-array.toml#t003_null_2": "matching", + "translation/functions/string.string-to-array.toml#t004_boundary_1": "matching", + "translation/functions/string.string-to-array.toml#t005_boundary_2": "matching", + "translation/functions/string.string-to-array.toml#t006_boundary_3": "matching", + "translation/functions/string.string-to-array.toml#t007_boundary_4": "matching", + "translation/functions/string.string-to-array.toml#t008_wrong_kind": "matching_rejection", + "translation/functions/string.string-to-table.toml#t001_types_1": "matching", + "translation/functions/string.string-to-table.toml#t002_null_1": "matching", + "translation/functions/string.string-to-table.toml#t003_null_2": "matching", + "translation/functions/string.string-to-table.toml#t004_boundary_1": "matching", + "translation/functions/string.string-to-table.toml#t005_boundary_2": "matching", + "translation/functions/string.string-to-table.toml#t006_boundary_3": "matching", + "translation/functions/string.string-to-table.toml#t007_boundary_4": "matching", + "translation/functions/string.string-to-table.toml#t008_wrong_kind": "matching_rejection", "translation/functions/string.strpos.toml#t001_types_1": "matching", "translation/functions/string.strpos.toml#t002_null_1": "matching", "translation/functions/string.strpos.toml#t003_null_2": "matching", @@ -2863,15 +2891,15 @@ "translation/functions/string.substr.toml#t006_boundary_3": "matching", "translation/functions/string.substr.toml#t007_boundary_4": "matching", "translation/functions/string.substr.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/string.substring-from-for.toml#t001_types_1": "refused", - "translation/functions/string.substring-from-for.toml#t002_null_1": "refused", - "translation/functions/string.substring-from-for.toml#t003_null_2": "refused", - "translation/functions/string.substring-from-for.toml#t004_null_3": "refused", - "translation/functions/string.substring-from-for.toml#t005_boundary_1": "refused", - "translation/functions/string.substring-from-for.toml#t006_boundary_2": "refused", - "translation/functions/string.substring-from-for.toml#t007_boundary_3": "refused", - "translation/functions/string.substring-from-for.toml#t008_boundary_4": "refused", - "translation/functions/string.substring-from-for.toml#t009_wrong_kind": "refused", + "translation/functions/string.substring-from-for.toml#t001_types_1": "matching", + "translation/functions/string.substring-from-for.toml#t002_null_1": "matching", + "translation/functions/string.substring-from-for.toml#t003_null_2": "matching", + "translation/functions/string.substring-from-for.toml#t004_null_3": "matching", + "translation/functions/string.substring-from-for.toml#t005_boundary_1": "matching", + "translation/functions/string.substring-from-for.toml#t006_boundary_2": "matching", + "translation/functions/string.substring-from-for.toml#t007_boundary_3": "matching", + "translation/functions/string.substring-from-for.toml#t008_boundary_4": "matching", + "translation/functions/string.substring-from-for.toml#t009_wrong_kind": "matching_rejection", "translation/functions/string.substring-from.toml#t001_types_1": "matching", "translation/functions/string.substring-from.toml#t002_null_1": "matching", "translation/functions/string.substring-from.toml#t003_null_2": "matching", @@ -2880,15 +2908,15 @@ "translation/functions/string.substring-from.toml#t006_boundary_3": "matching", "translation/functions/string.substring-from.toml#t007_boundary_4": "matching", "translation/functions/string.substring-from.toml#t008_wrong_kind": "matching_rejection", - "translation/functions/string.substring-similar-escape.toml#t001_types_1": "refused", - "translation/functions/string.substring-similar-escape.toml#t002_null_1": "refused", - "translation/functions/string.substring-similar-escape.toml#t003_null_2": "refused", - "translation/functions/string.substring-similar-escape.toml#t004_null_3": "refused", - "translation/functions/string.substring-similar-escape.toml#t005_boundary_1": "refused", - "translation/functions/string.substring-similar-escape.toml#t006_boundary_2": "refused", - "translation/functions/string.substring-similar-escape.toml#t007_boundary_3": "refused", - "translation/functions/string.substring-similar-escape.toml#t008_boundary_4": "refused", - "translation/functions/string.substring-similar-escape.toml#t009_wrong_kind": "refused", + "translation/functions/string.substring-similar-escape.toml#t001_types_1": "matching", + "translation/functions/string.substring-similar-escape.toml#t002_null_1": "matching", + "translation/functions/string.substring-similar-escape.toml#t003_null_2": "matching", + "translation/functions/string.substring-similar-escape.toml#t004_null_3": "matching", + "translation/functions/string.substring-similar-escape.toml#t005_boundary_1": "matching", + "translation/functions/string.substring-similar-escape.toml#t006_boundary_2": "matching", + "translation/functions/string.substring-similar-escape.toml#t007_boundary_3": "matching", + "translation/functions/string.substring-similar-escape.toml#t008_boundary_4": "matching", + "translation/functions/string.substring-similar-escape.toml#t009_wrong_kind": "matching_rejection", "translation/functions/string.substring.toml#t001_types_1": "matching_rejection", "translation/functions/string.substring.toml#t002_null_1": "matching_rejection", "translation/functions/string.substring.toml#t003_boundary_1": "matching_rejection", @@ -2946,9 +2974,9 @@ "translation/functions/string.upper.toml#t003_boundary_1": "matching", "translation/functions/string.upper.toml#t004_boundary_2": "matching", "translation/functions/string.upper.toml#t005_wrong_kind": "matching_rejection", - "translation/functions/uuid.uuid-extract-timestamp.toml#t001_types_1": "refused", - "translation/functions/uuid.uuid-extract-timestamp.toml#t002_null_1": "refused", - "translation/functions/uuid.uuid-extract-timestamp.toml#t003_wrong_kind": "refused", + "translation/functions/uuid.uuid-extract-timestamp.toml#t001_types_1": "matching", + "translation/functions/uuid.uuid-extract-timestamp.toml#t002_null_1": "matching", + "translation/functions/uuid.uuid-extract-timestamp.toml#t003_wrong_kind": "matching_rejection", "translation/functions/uuid.uuid-extract-version.toml#t001_types_1": "matching", "translation/functions/uuid.uuid-extract-version.toml#t002_null_1": "matching", "translation/functions/uuid.uuid-extract-version.toml#t003_wrong_kind": "matching_rejection", @@ -3004,181 +3032,181 @@ "translation/utility/prepare.toml#e002": "matching" }, "forms": { - "pg.ddl.alter-aggregate.owner-to": "unmeasured", + "pg.ddl.alter-aggregate.owner-to": "not_translatable", "pg.ddl.alter-aggregate.rename-to": "unmeasured", "pg.ddl.alter-aggregate.set-schema": "unmeasured", - "pg.ddl.alter-collation.owner-to": "unmeasured", - "pg.ddl.alter-collation.refresh-version": "unmeasured", + "pg.ddl.alter-collation.owner-to": "not_translatable", + "pg.ddl.alter-collation.refresh-version": "not_translatable", "pg.ddl.alter-collation.rename-to": "unmeasured", "pg.ddl.alter-collation.set-schema": "unmeasured", - "pg.ddl.alter-conversion.owner-to": "unmeasured", - "pg.ddl.alter-conversion.rename-to": "unmeasured", - "pg.ddl.alter-conversion.set-schema": "unmeasured", - "pg.ddl.alter-database.name": "unmeasured", - "pg.ddl.alter-database.owner-to": "unmeasured", - "pg.ddl.alter-database.refresh-collation-version": "unmeasured", - "pg.ddl.alter-database.rename-to": "unmeasured", - "pg.ddl.alter-database.reset": "unmeasured", - "pg.ddl.alter-database.reset-all": "unmeasured", - "pg.ddl.alter-database.set": "unmeasured", - "pg.ddl.alter-database.set-from-current": "unmeasured", - "pg.ddl.alter-database.set-tablespace": "unmeasured", + "pg.ddl.alter-conversion.owner-to": "not_translatable", + "pg.ddl.alter-conversion.rename-to": "not_translatable", + "pg.ddl.alter-conversion.set-schema": "not_translatable", + "pg.ddl.alter-database.name": "not_translatable", + "pg.ddl.alter-database.owner-to": "not_translatable", + "pg.ddl.alter-database.refresh-collation-version": "not_translatable", + "pg.ddl.alter-database.rename-to": "not_translatable", + "pg.ddl.alter-database.reset": "not_translatable", + "pg.ddl.alter-database.reset-all": "not_translatable", + "pg.ddl.alter-database.set": "not_translatable", + "pg.ddl.alter-database.set-from-current": "not_translatable", + "pg.ddl.alter-database.set-tablespace": "not_translatable", "pg.ddl.alter-domain.add": "unmeasured", "pg.ddl.alter-domain.drop-constraint": "unmeasured", "pg.ddl.alter-domain.name": "unmeasured", "pg.ddl.alter-domain.not-null": "unmeasured", - "pg.ddl.alter-domain.owner-to": "unmeasured", + "pg.ddl.alter-domain.owner-to": "not_translatable", "pg.ddl.alter-domain.rename-constraint-to": "unmeasured", "pg.ddl.alter-domain.rename-to": "unmeasured", "pg.ddl.alter-domain.set-schema": "unmeasured", "pg.ddl.alter-domain.validate-constraint": "unmeasured", - "pg.ddl.alter-event-trigger.disable": "unmeasured", - "pg.ddl.alter-event-trigger.enable": "unmeasured", - "pg.ddl.alter-event-trigger.owner-to": "unmeasured", - "pg.ddl.alter-event-trigger.rename-to": "unmeasured", - "pg.ddl.alter-extension.add": "unmeasured", - "pg.ddl.alter-extension.drop": "unmeasured", - "pg.ddl.alter-extension.set-schema": "unmeasured", - "pg.ddl.alter-extension.update": "unmeasured", - "pg.ddl.alter-foreign-data-wrapper.name": "unmeasured", - "pg.ddl.alter-foreign-data-wrapper.owner-to": "unmeasured", - "pg.ddl.alter-foreign-data-wrapper.rename-to": "unmeasured", - "pg.ddl.alter-foreign-table.add-column-collate": "unmeasured", - "pg.ddl.alter-foreign-table.add-valid": "unmeasured", - "pg.ddl.alter-foreign-table.alter-drop-default": "unmeasured", - "pg.ddl.alter-foreign-table.alter-not-null": "unmeasured", - "pg.ddl.alter-foreign-table.alter-options": "unmeasured", - "pg.ddl.alter-foreign-table.alter-reset": "unmeasured", - "pg.ddl.alter-foreign-table.alter-set": "unmeasured", - "pg.ddl.alter-foreign-table.alter-set-default": "unmeasured", - "pg.ddl.alter-foreign-table.alter-set-statistics": "unmeasured", - "pg.ddl.alter-foreign-table.alter-set-storage": "unmeasured", - "pg.ddl.alter-foreign-table.alter-type": "unmeasured", - "pg.ddl.alter-foreign-table.disable-trigger": "unmeasured", - "pg.ddl.alter-foreign-table.drop": "unmeasured", - "pg.ddl.alter-foreign-table.drop-constraint": "unmeasured", - "pg.ddl.alter-foreign-table.enable-always-trigger": "unmeasured", - "pg.ddl.alter-foreign-table.enable-replica-trigger": "unmeasured", - "pg.ddl.alter-foreign-table.enable-trigger": "unmeasured", - "pg.ddl.alter-foreign-table.inherit": "unmeasured", - "pg.ddl.alter-foreign-table.no-inherit": "unmeasured", - "pg.ddl.alter-foreign-table.options": "unmeasured", - "pg.ddl.alter-foreign-table.owner-to": "unmeasured", - "pg.ddl.alter-foreign-table.rename-to": "unmeasured", - "pg.ddl.alter-foreign-table.rename-to-only-column": "unmeasured", - "pg.ddl.alter-foreign-table.set-schema": "unmeasured", - "pg.ddl.alter-foreign-table.set-without-oids": "unmeasured", - "pg.ddl.alter-foreign-table.validate-constraint": "unmeasured", + "pg.ddl.alter-event-trigger.disable": "not_translatable", + "pg.ddl.alter-event-trigger.enable": "not_translatable", + "pg.ddl.alter-event-trigger.owner-to": "not_translatable", + "pg.ddl.alter-event-trigger.rename-to": "not_translatable", + "pg.ddl.alter-extension.add": "not_translatable", + "pg.ddl.alter-extension.drop": "not_translatable", + "pg.ddl.alter-extension.set-schema": "not_translatable", + "pg.ddl.alter-extension.update": "not_translatable", + "pg.ddl.alter-foreign-data-wrapper.name": "not_translatable", + "pg.ddl.alter-foreign-data-wrapper.owner-to": "not_translatable", + "pg.ddl.alter-foreign-data-wrapper.rename-to": "not_translatable", + "pg.ddl.alter-foreign-table.add-column-collate": "not_translatable", + "pg.ddl.alter-foreign-table.add-valid": "not_translatable", + "pg.ddl.alter-foreign-table.alter-drop-default": "not_translatable", + "pg.ddl.alter-foreign-table.alter-not-null": "not_translatable", + "pg.ddl.alter-foreign-table.alter-options": "not_translatable", + "pg.ddl.alter-foreign-table.alter-reset": "not_translatable", + "pg.ddl.alter-foreign-table.alter-set": "not_translatable", + "pg.ddl.alter-foreign-table.alter-set-default": "not_translatable", + "pg.ddl.alter-foreign-table.alter-set-statistics": "not_translatable", + "pg.ddl.alter-foreign-table.alter-set-storage": "not_translatable", + "pg.ddl.alter-foreign-table.alter-type": "not_translatable", + "pg.ddl.alter-foreign-table.disable-trigger": "not_translatable", + "pg.ddl.alter-foreign-table.drop": "not_translatable", + "pg.ddl.alter-foreign-table.drop-constraint": "not_translatable", + "pg.ddl.alter-foreign-table.enable-always-trigger": "not_translatable", + "pg.ddl.alter-foreign-table.enable-replica-trigger": "not_translatable", + "pg.ddl.alter-foreign-table.enable-trigger": "not_translatable", + "pg.ddl.alter-foreign-table.inherit": "not_translatable", + "pg.ddl.alter-foreign-table.no-inherit": "not_translatable", + "pg.ddl.alter-foreign-table.options": "not_translatable", + "pg.ddl.alter-foreign-table.owner-to": "not_translatable", + "pg.ddl.alter-foreign-table.rename-to": "not_translatable", + "pg.ddl.alter-foreign-table.rename-to-only-column": "not_translatable", + "pg.ddl.alter-foreign-table.set-schema": "not_translatable", + "pg.ddl.alter-foreign-table.set-without-oids": "not_translatable", + "pg.ddl.alter-foreign-table.validate-constraint": "not_translatable", "pg.ddl.alter-function.called-on-null-input": "unmeasured", - "pg.ddl.alter-function.cost": "unmeasured", - "pg.ddl.alter-function.depends-on-extension": "unmeasured", - "pg.ddl.alter-function.immutable-stable-volatile": "unmeasured", - "pg.ddl.alter-function.leakproof": "unmeasured", - "pg.ddl.alter-function.owner-to": "unmeasured", - "pg.ddl.alter-function.parallel": "unmeasured", + "pg.ddl.alter-function.cost": "not_translatable", + "pg.ddl.alter-function.depends-on-extension": "not_translatable", + "pg.ddl.alter-function.immutable-stable-volatile": "not_translatable", + "pg.ddl.alter-function.leakproof": "not_translatable", + "pg.ddl.alter-function.owner-to": "not_translatable", + "pg.ddl.alter-function.parallel": "not_translatable", "pg.ddl.alter-function.rename-to": "unmeasured", - "pg.ddl.alter-function.reset": "unmeasured", - "pg.ddl.alter-function.reset-all": "unmeasured", - "pg.ddl.alter-function.rows": "unmeasured", - "pg.ddl.alter-function.security-invoker-security-definer": "unmeasured", - "pg.ddl.alter-function.set": "unmeasured", - "pg.ddl.alter-function.set-from-current": "unmeasured", + "pg.ddl.alter-function.reset": "not_translatable", + "pg.ddl.alter-function.reset-all": "not_translatable", + "pg.ddl.alter-function.rows": "not_translatable", + "pg.ddl.alter-function.security-invoker-security-definer": "not_translatable", + "pg.ddl.alter-function.set": "not_translatable", + "pg.ddl.alter-function.set-from-current": "not_translatable", "pg.ddl.alter-function.set-schema": "unmeasured", - "pg.ddl.alter-function.support": "unmeasured", - "pg.ddl.alter-index.all-in-tablespace-set": "unmeasured", - "pg.ddl.alter-index.alter-set-statistics": "unmeasured", - "pg.ddl.alter-index.attach-partition": "unmeasured", - "pg.ddl.alter-index.depends-on-extension": "unmeasured", + "pg.ddl.alter-function.support": "not_translatable", + "pg.ddl.alter-index.all-in-tablespace-set": "not_translatable", + "pg.ddl.alter-index.alter-set-statistics": "not_translatable", + "pg.ddl.alter-index.attach-partition": "not_translatable", + "pg.ddl.alter-index.depends-on-extension": "not_translatable", "pg.ddl.alter-index.rename-to": "refused", - "pg.ddl.alter-index.reset": "unmeasured", - "pg.ddl.alter-index.set": "unmeasured", - "pg.ddl.alter-index.set-tablespace": "unmeasured", - "pg.ddl.alter-language.owner-to": "unmeasured", - "pg.ddl.alter-language.rename-to": "unmeasured", - "pg.ddl.alter-large-object": "unmeasured", - "pg.ddl.alter-materialized-view.all-in-tablespace-set": "unmeasured", - "pg.ddl.alter-materialized-view.alter-reset": "unmeasured", - "pg.ddl.alter-materialized-view.alter-set": "unmeasured", - "pg.ddl.alter-materialized-view.alter-set-compression": "unmeasured", - "pg.ddl.alter-materialized-view.alter-set-statistics": "unmeasured", - "pg.ddl.alter-materialized-view.alter-set-storage": "unmeasured", - "pg.ddl.alter-materialized-view.cluster-on": "unmeasured", - "pg.ddl.alter-materialized-view.depends-on-extension": "unmeasured", - "pg.ddl.alter-materialized-view.owner-to": "unmeasured", + "pg.ddl.alter-index.reset": "not_translatable", + "pg.ddl.alter-index.set": "not_translatable", + "pg.ddl.alter-index.set-tablespace": "not_translatable", + "pg.ddl.alter-language.owner-to": "not_translatable", + "pg.ddl.alter-language.rename-to": "not_translatable", + "pg.ddl.alter-large-object": "not_translatable", + "pg.ddl.alter-materialized-view.all-in-tablespace-set": "not_translatable", + "pg.ddl.alter-materialized-view.alter-reset": "not_translatable", + "pg.ddl.alter-materialized-view.alter-set": "not_translatable", + "pg.ddl.alter-materialized-view.alter-set-compression": "not_translatable", + "pg.ddl.alter-materialized-view.alter-set-statistics": "not_translatable", + "pg.ddl.alter-materialized-view.alter-set-storage": "not_translatable", + "pg.ddl.alter-materialized-view.cluster-on": "not_translatable", + "pg.ddl.alter-materialized-view.depends-on-extension": "not_translatable", + "pg.ddl.alter-materialized-view.owner-to": "not_translatable", "pg.ddl.alter-materialized-view.rename-to": "unmeasured", "pg.ddl.alter-materialized-view.rename-to-column": "unmeasured", - "pg.ddl.alter-materialized-view.reset": "unmeasured", - "pg.ddl.alter-materialized-view.set": "unmeasured", - "pg.ddl.alter-materialized-view.set-access-method": "unmeasured", + "pg.ddl.alter-materialized-view.reset": "not_translatable", + "pg.ddl.alter-materialized-view.set": "not_translatable", + "pg.ddl.alter-materialized-view.set-access-method": "not_translatable", "pg.ddl.alter-materialized-view.set-schema": "unmeasured", - "pg.ddl.alter-materialized-view.set-tablespace": "unmeasured", - "pg.ddl.alter-materialized-view.set-without-cluster": "unmeasured", - "pg.ddl.alter-operator-class.owner-to": "unmeasured", - "pg.ddl.alter-operator-class.rename-to": "unmeasured", - "pg.ddl.alter-operator-class.set-schema": "unmeasured", - "pg.ddl.alter-operator-family.add": "unmeasured", - "pg.ddl.alter-operator-family.drop": "unmeasured", - "pg.ddl.alter-operator-family.owner-to": "unmeasured", - "pg.ddl.alter-operator-family.rename-to": "unmeasured", - "pg.ddl.alter-operator-family.set-schema": "unmeasured", - "pg.ddl.alter-operator.owner-to": "unmeasured", - "pg.ddl.alter-operator.set": "unmeasured", + "pg.ddl.alter-materialized-view.set-tablespace": "not_translatable", + "pg.ddl.alter-materialized-view.set-without-cluster": "not_translatable", + "pg.ddl.alter-operator-class.owner-to": "not_translatable", + "pg.ddl.alter-operator-class.rename-to": "not_translatable", + "pg.ddl.alter-operator-class.set-schema": "not_translatable", + "pg.ddl.alter-operator-family.add": "not_translatable", + "pg.ddl.alter-operator-family.drop": "not_translatable", + "pg.ddl.alter-operator-family.owner-to": "not_translatable", + "pg.ddl.alter-operator-family.rename-to": "not_translatable", + "pg.ddl.alter-operator-family.set-schema": "not_translatable", + "pg.ddl.alter-operator.owner-to": "not_translatable", + "pg.ddl.alter-operator.set": "not_translatable", "pg.ddl.alter-operator.set-schema": "unmeasured", - "pg.ddl.alter-procedure.depends-on-extension": "unmeasured", - "pg.ddl.alter-procedure.owner-to": "unmeasured", + "pg.ddl.alter-procedure.depends-on-extension": "not_translatable", + "pg.ddl.alter-procedure.owner-to": "not_translatable", "pg.ddl.alter-procedure.rename-to": "unmeasured", - "pg.ddl.alter-procedure.reset": "unmeasured", - "pg.ddl.alter-procedure.reset-all": "unmeasured", - "pg.ddl.alter-procedure.security-invoker-security-definer": "unmeasured", - "pg.ddl.alter-procedure.set": "unmeasured", - "pg.ddl.alter-procedure.set-from-current": "unmeasured", + "pg.ddl.alter-procedure.reset": "not_translatable", + "pg.ddl.alter-procedure.reset-all": "not_translatable", + "pg.ddl.alter-procedure.security-invoker-security-definer": "not_translatable", + "pg.ddl.alter-procedure.set": "not_translatable", + "pg.ddl.alter-procedure.set-from-current": "not_translatable", "pg.ddl.alter-procedure.set-schema": "unmeasured", - "pg.ddl.alter-publication.add": "unmeasured", - "pg.ddl.alter-publication.drop": "unmeasured", - "pg.ddl.alter-publication.owner-to": "unmeasured", - "pg.ddl.alter-publication.rename-to": "unmeasured", - "pg.ddl.alter-publication.set-name-publication-object": "unmeasured", - "pg.ddl.alter-publication.set-name-publication-parameter": "unmeasured", - "pg.ddl.alter-routine.cost": "unmeasured", - "pg.ddl.alter-routine.depends-on-extension": "unmeasured", - "pg.ddl.alter-routine.immutable-stable-volatile": "unmeasured", - "pg.ddl.alter-routine.leakproof": "unmeasured", - "pg.ddl.alter-routine.owner-to": "unmeasured", - "pg.ddl.alter-routine.parallel": "unmeasured", + "pg.ddl.alter-publication.add": "not_translatable", + "pg.ddl.alter-publication.drop": "not_translatable", + "pg.ddl.alter-publication.owner-to": "not_translatable", + "pg.ddl.alter-publication.rename-to": "not_translatable", + "pg.ddl.alter-publication.set-name-publication-object": "not_translatable", + "pg.ddl.alter-publication.set-name-publication-parameter": "not_translatable", + "pg.ddl.alter-routine.cost": "not_translatable", + "pg.ddl.alter-routine.depends-on-extension": "not_translatable", + "pg.ddl.alter-routine.immutable-stable-volatile": "not_translatable", + "pg.ddl.alter-routine.leakproof": "not_translatable", + "pg.ddl.alter-routine.owner-to": "not_translatable", + "pg.ddl.alter-routine.parallel": "not_translatable", "pg.ddl.alter-routine.rename-to": "unmeasured", - "pg.ddl.alter-routine.reset": "unmeasured", - "pg.ddl.alter-routine.reset-all": "unmeasured", - "pg.ddl.alter-routine.rows": "unmeasured", - "pg.ddl.alter-routine.security-invoker-security-definer": "unmeasured", - "pg.ddl.alter-routine.set": "unmeasured", - "pg.ddl.alter-routine.set-from-current": "unmeasured", + "pg.ddl.alter-routine.reset": "not_translatable", + "pg.ddl.alter-routine.reset-all": "not_translatable", + "pg.ddl.alter-routine.rows": "not_translatable", + "pg.ddl.alter-routine.security-invoker-security-definer": "not_translatable", + "pg.ddl.alter-routine.set": "not_translatable", + "pg.ddl.alter-routine.set-from-current": "not_translatable", "pg.ddl.alter-routine.set-schema": "unmeasured", "pg.ddl.alter-rule": "unmeasured", - "pg.ddl.alter-schema.owner-to": "unmeasured", + "pg.ddl.alter-schema.owner-to": "not_translatable", "pg.ddl.alter-schema.rename-to": "unmeasured", "pg.ddl.alter-sequence.name": "unmeasured", - "pg.ddl.alter-sequence.owner-to": "unmeasured", + "pg.ddl.alter-sequence.owner-to": "not_translatable", "pg.ddl.alter-sequence.rename-to": "refused", "pg.ddl.alter-sequence.set": "unmeasured", "pg.ddl.alter-sequence.set-schema": "unmeasured", - "pg.ddl.alter-server.name": "unmeasured", - "pg.ddl.alter-server.owner-to": "unmeasured", - "pg.ddl.alter-server.rename-to": "unmeasured", - "pg.ddl.alter-statistics.owner-to": "unmeasured", - "pg.ddl.alter-statistics.rename-to": "unmeasured", - "pg.ddl.alter-statistics.set-schema": "unmeasured", - "pg.ddl.alter-statistics.set-statistics": "unmeasured", - "pg.ddl.alter-subscription.add-publication": "unmeasured", - "pg.ddl.alter-subscription.connection": "unmeasured", - "pg.ddl.alter-subscription.disable": "unmeasured", - "pg.ddl.alter-subscription.drop-publication": "unmeasured", - "pg.ddl.alter-subscription.enable": "unmeasured", - "pg.ddl.alter-subscription.owner-to": "unmeasured", - "pg.ddl.alter-subscription.refresh-publication": "unmeasured", - "pg.ddl.alter-subscription.rename-to": "unmeasured", - "pg.ddl.alter-subscription.set": "unmeasured", - "pg.ddl.alter-subscription.set-publication": "unmeasured", - "pg.ddl.alter-subscription.skip": "unmeasured", + "pg.ddl.alter-server.name": "not_translatable", + "pg.ddl.alter-server.owner-to": "not_translatable", + "pg.ddl.alter-server.rename-to": "not_translatable", + "pg.ddl.alter-statistics.owner-to": "not_translatable", + "pg.ddl.alter-statistics.rename-to": "not_translatable", + "pg.ddl.alter-statistics.set-schema": "not_translatable", + "pg.ddl.alter-statistics.set-statistics": "not_translatable", + "pg.ddl.alter-subscription.add-publication": "not_translatable", + "pg.ddl.alter-subscription.connection": "not_translatable", + "pg.ddl.alter-subscription.disable": "not_translatable", + "pg.ddl.alter-subscription.drop-publication": "not_translatable", + "pg.ddl.alter-subscription.enable": "not_translatable", + "pg.ddl.alter-subscription.owner-to": "not_translatable", + "pg.ddl.alter-subscription.refresh-publication": "not_translatable", + "pg.ddl.alter-subscription.rename-to": "not_translatable", + "pg.ddl.alter-subscription.set": "not_translatable", + "pg.ddl.alter-subscription.set-publication": "not_translatable", + "pg.ddl.alter-subscription.skip": "not_translatable", "pg.ddl.alter-table.add": "unmeasured", "pg.ddl.alter-table.add-column-not-collate": "matching", "pg.ddl.alter-table.add-not-valid": "unmeasured", @@ -3191,91 +3219,91 @@ "pg.ddl.alter-table.alter-drop-expression": "unmeasured", "pg.ddl.alter-table.alter-drop-identity": "unmeasured", "pg.ddl.alter-table.alter-not-null": "matching", - "pg.ddl.alter-table.alter-reset": "unmeasured", - "pg.ddl.alter-table.alter-set": "unmeasured", - "pg.ddl.alter-table.alter-set-compression": "unmeasured", + "pg.ddl.alter-table.alter-reset": "not_translatable", + "pg.ddl.alter-table.alter-set": "not_translatable", + "pg.ddl.alter-table.alter-set-compression": "not_translatable", "pg.ddl.alter-table.alter-set-default": "matching", "pg.ddl.alter-table.alter-set-expression-as": "unmeasured", - "pg.ddl.alter-table.alter-set-statistics": "unmeasured", - "pg.ddl.alter-table.alter-set-storage": "unmeasured", + "pg.ddl.alter-table.alter-set-statistics": "not_translatable", + "pg.ddl.alter-table.alter-set-storage": "not_translatable", "pg.ddl.alter-table.alter-type": "matching", "pg.ddl.alter-table.attach-partition": "unmeasured", - "pg.ddl.alter-table.cluster-on": "unmeasured", + "pg.ddl.alter-table.cluster-on": "not_translatable", "pg.ddl.alter-table.detach-partition": "unmeasured", "pg.ddl.alter-table.disable-row-level-security": "unmeasured", "pg.ddl.alter-table.disable-rule": "unmeasured", - "pg.ddl.alter-table.disable-trigger": "unmeasured", + "pg.ddl.alter-table.disable-trigger": "not_translatable", "pg.ddl.alter-table.drop": "matching", "pg.ddl.alter-table.drop-constraint": "unmeasured", "pg.ddl.alter-table.enable-always-rule": "unmeasured", - "pg.ddl.alter-table.enable-always-trigger": "unmeasured", + "pg.ddl.alter-table.enable-always-trigger": "not_translatable", "pg.ddl.alter-table.enable-replica-rule": "unmeasured", - "pg.ddl.alter-table.enable-replica-trigger": "unmeasured", + "pg.ddl.alter-table.enable-replica-trigger": "not_translatable", "pg.ddl.alter-table.enable-row-level-security": "unmeasured", "pg.ddl.alter-table.enable-rule": "unmeasured", - "pg.ddl.alter-table.enable-trigger": "unmeasured", + "pg.ddl.alter-table.enable-trigger": "not_translatable", "pg.ddl.alter-table.force-row-level-security": "unmeasured", "pg.ddl.alter-table.inherit": "unmeasured", "pg.ddl.alter-table.no-force-row-level": "unmeasured", "pg.ddl.alter-table.no-inherit": "unmeasured", "pg.ddl.alter-table.not-of": "unmeasured", "pg.ddl.alter-table.of": "unmeasured", - "pg.ddl.alter-table.owner-to": "unmeasured", + "pg.ddl.alter-table.owner-to": "not_translatable", "pg.ddl.alter-table.rename-constraint-to": "unmeasured", "pg.ddl.alter-table.rename-to": "matching", "pg.ddl.alter-table.rename-to-only-column": "matching", - "pg.ddl.alter-table.replica-identity": "unmeasured", - "pg.ddl.alter-table.reset": "unmeasured", - "pg.ddl.alter-table.set": "unmeasured", - "pg.ddl.alter-table.set-access-method": "unmeasured", - "pg.ddl.alter-table.set-logged-unlogged": "unmeasured", + "pg.ddl.alter-table.replica-identity": "not_translatable", + "pg.ddl.alter-table.reset": "not_translatable", + "pg.ddl.alter-table.set": "not_translatable", + "pg.ddl.alter-table.set-access-method": "not_translatable", + "pg.ddl.alter-table.set-logged-unlogged": "not_translatable", "pg.ddl.alter-table.set-schema": "unmeasured", - "pg.ddl.alter-table.set-tablespace": "unmeasured", - "pg.ddl.alter-table.set-without-cluster": "unmeasured", - "pg.ddl.alter-table.set-without-oids": "unmeasured", + "pg.ddl.alter-table.set-tablespace": "not_translatable", + "pg.ddl.alter-table.set-without-cluster": "not_translatable", + "pg.ddl.alter-table.set-without-oids": "not_translatable", "pg.ddl.alter-table.validate-constraint": "unmeasured", - "pg.ddl.alter-tablespace.owner-to": "unmeasured", - "pg.ddl.alter-tablespace.rename-to": "unmeasured", - "pg.ddl.alter-tablespace.reset": "unmeasured", - "pg.ddl.alter-tablespace.set": "unmeasured", - "pg.ddl.alter-text-search-configuration.add-mapping-for-with": "unmeasured", - "pg.ddl.alter-text-search-configuration.alter-mapping-for-replace": "unmeasured", - "pg.ddl.alter-text-search-configuration.alter-mapping-for-with": "unmeasured", - "pg.ddl.alter-text-search-configuration.alter-mapping-replace-with": "unmeasured", - "pg.ddl.alter-text-search-configuration.drop-mapping-for": "unmeasured", - "pg.ddl.alter-text-search-configuration.owner-to": "unmeasured", - "pg.ddl.alter-text-search-configuration.rename-to": "unmeasured", - "pg.ddl.alter-text-search-configuration.set-schema": "unmeasured", - "pg.ddl.alter-text-search-dictionary.name-option": "unmeasured", - "pg.ddl.alter-text-search-dictionary.owner-to": "unmeasured", - "pg.ddl.alter-text-search-dictionary.rename-to": "unmeasured", - "pg.ddl.alter-text-search-dictionary.set-schema": "unmeasured", - "pg.ddl.alter-text-search-parser.rename-to": "unmeasured", - "pg.ddl.alter-text-search-parser.set-schema": "unmeasured", - "pg.ddl.alter-text-search-template.rename-to": "unmeasured", - "pg.ddl.alter-text-search-template.set-schema": "unmeasured", - "pg.ddl.alter-trigger.depends-on-extension": "unmeasured", - "pg.ddl.alter-trigger.rename-to": "unmeasured", + "pg.ddl.alter-tablespace.owner-to": "not_translatable", + "pg.ddl.alter-tablespace.rename-to": "not_translatable", + "pg.ddl.alter-tablespace.reset": "not_translatable", + "pg.ddl.alter-tablespace.set": "not_translatable", + "pg.ddl.alter-text-search-configuration.add-mapping-for-with": "not_translatable", + "pg.ddl.alter-text-search-configuration.alter-mapping-for-replace": "not_translatable", + "pg.ddl.alter-text-search-configuration.alter-mapping-for-with": "not_translatable", + "pg.ddl.alter-text-search-configuration.alter-mapping-replace-with": "not_translatable", + "pg.ddl.alter-text-search-configuration.drop-mapping-for": "not_translatable", + "pg.ddl.alter-text-search-configuration.owner-to": "not_translatable", + "pg.ddl.alter-text-search-configuration.rename-to": "not_translatable", + "pg.ddl.alter-text-search-configuration.set-schema": "not_translatable", + "pg.ddl.alter-text-search-dictionary.name-option": "not_translatable", + "pg.ddl.alter-text-search-dictionary.owner-to": "not_translatable", + "pg.ddl.alter-text-search-dictionary.rename-to": "not_translatable", + "pg.ddl.alter-text-search-dictionary.set-schema": "not_translatable", + "pg.ddl.alter-text-search-parser.rename-to": "not_translatable", + "pg.ddl.alter-text-search-parser.set-schema": "not_translatable", + "pg.ddl.alter-text-search-template.rename-to": "not_translatable", + "pg.ddl.alter-text-search-template.set-schema": "not_translatable", + "pg.ddl.alter-trigger.depends-on-extension": "not_translatable", + "pg.ddl.alter-trigger.rename-to": "not_translatable", "pg.ddl.alter-type.add-attribute": "unmeasured", "pg.ddl.alter-type.add-value": "unmeasured", "pg.ddl.alter-type.alter-attribute-type": "unmeasured", "pg.ddl.alter-type.drop-attribute": "unmeasured", - "pg.ddl.alter-type.owner-to": "unmeasured", + "pg.ddl.alter-type.owner-to": "not_translatable", "pg.ddl.alter-type.rename-attribute-to": "unmeasured", "pg.ddl.alter-type.rename-to": "unmeasured", "pg.ddl.alter-type.rename-value-to": "unmeasured", - "pg.ddl.alter-type.set": "unmeasured", + "pg.ddl.alter-type.set": "not_translatable", "pg.ddl.alter-type.set-schema": "unmeasured", "pg.ddl.alter-view.alter-drop-default": "unmeasured", "pg.ddl.alter-view.alter-set-default": "unmeasured", - "pg.ddl.alter-view.owner-to": "unmeasured", + "pg.ddl.alter-view.owner-to": "not_translatable", "pg.ddl.alter-view.rename-to": "matching", "pg.ddl.alter-view.rename-to-column": "refused", - "pg.ddl.alter-view.reset": "unmeasured", - "pg.ddl.alter-view.set": "unmeasured", + "pg.ddl.alter-view.reset": "not_translatable", + "pg.ddl.alter-view.set": "not_translatable", "pg.ddl.alter-view.set-schema": "unmeasured", "pg.ddl.comment": "unmeasured", - "pg.ddl.create-access-method": "unmeasured", + "pg.ddl.create-access-method": "not_translatable", "pg.ddl.create-aggregate.basetype-sfunc-stype": "unmeasured", "pg.ddl.create-aggregate.order-by-sfunc-stype": "unmeasured", "pg.ddl.create-aggregate.sfunc-stype": "unmeasured", @@ -3283,99 +3311,99 @@ "pg.ddl.create-cast.with-inout": "unmeasured", "pg.ddl.create-cast.without-function": "unmeasured", "pg.ddl.create-collation.from": "unmeasured", - "pg.ddl.create-collation.name": "unmeasured", - "pg.ddl.create-conversion": "unmeasured", - "pg.ddl.create-database": "unmeasured", + "pg.ddl.create-collation.name": "not_translatable", + "pg.ddl.create-conversion": "not_translatable", + "pg.ddl.create-database": "not_translatable", "pg.ddl.create-domain": "unmeasured", - "pg.ddl.create-event-trigger": "unmeasured", - "pg.ddl.create-extension": "unmeasured", - "pg.ddl.create-foreign-data-wrapper": "unmeasured", - "pg.ddl.create-foreign-table.partition-of-server": "unmeasured", - "pg.ddl.create-foreign-table.server": "unmeasured", + "pg.ddl.create-event-trigger": "not_translatable", + "pg.ddl.create-extension": "not_translatable", + "pg.ddl.create-foreign-data-wrapper": "not_translatable", + "pg.ddl.create-foreign-table.partition-of-server": "not_translatable", + "pg.ddl.create-foreign-table.server": "not_translatable", "pg.ddl.create-function": "unmeasured", "pg.ddl.create-function.sql-body-atomic": "unmeasured", "pg.ddl.create-function.sql-body-return": "unmeasured", "pg.ddl.create-index": "matching", - "pg.ddl.create-language.handler": "unmeasured", - "pg.ddl.create-language.name": "unmeasured", + "pg.ddl.create-language.handler": "not_translatable", + "pg.ddl.create-language.name": "not_translatable", "pg.ddl.create-materialized-view": "unmeasured", "pg.ddl.create-operator": "unmeasured", - "pg.ddl.create-operator-class": "unmeasured", - "pg.ddl.create-operator-family": "unmeasured", + "pg.ddl.create-operator-class": "not_translatable", + "pg.ddl.create-operator-family": "not_translatable", "pg.ddl.create-procedure": "unmeasured", "pg.ddl.create-procedure.sql-body-atomic": "unmeasured", - "pg.ddl.create-publication": "unmeasured", + "pg.ddl.create-publication": "not_translatable", "pg.ddl.create-rule": "unmeasured", - "pg.ddl.create-schema.authorization": "unmeasured", + "pg.ddl.create-schema.authorization": "not_translatable", "pg.ddl.create-schema.if-not-exists": "matching", - "pg.ddl.create-schema.if-not-exists-authorization": "unmeasured", + "pg.ddl.create-schema.if-not-exists-authorization": "not_translatable", "pg.ddl.create-schema.schema-name": "matching", "pg.ddl.create-sequence": "matching", - "pg.ddl.create-server": "unmeasured", - "pg.ddl.create-statistics.from-table-name": "unmeasured", - "pg.ddl.create-statistics.table-name": "unmeasured", - "pg.ddl.create-subscription": "unmeasured", + "pg.ddl.create-server": "not_translatable", + "pg.ddl.create-statistics.from-table-name": "not_translatable", + "pg.ddl.create-statistics.table-name": "not_translatable", + "pg.ddl.create-subscription": "not_translatable", "pg.ddl.create-table-as": "matching", "pg.ddl.create-table.of": "unmeasured", "pg.ddl.create-table.partition-of": "unmeasured", "pg.ddl.create-table.table-name": "matching", - "pg.ddl.create-tablespace": "unmeasured", - "pg.ddl.create-text-search-configuration": "unmeasured", - "pg.ddl.create-text-search-dictionary": "unmeasured", - "pg.ddl.create-text-search-parser": "unmeasured", - "pg.ddl.create-text-search-template": "unmeasured", - "pg.ddl.create-transform": "unmeasured", - "pg.ddl.create-trigger": "unmeasured", + "pg.ddl.create-tablespace": "not_translatable", + "pg.ddl.create-text-search-configuration": "not_translatable", + "pg.ddl.create-text-search-dictionary": "not_translatable", + "pg.ddl.create-text-search-parser": "not_translatable", + "pg.ddl.create-text-search-template": "not_translatable", + "pg.ddl.create-transform": "not_translatable", + "pg.ddl.create-trigger": "not_translatable", "pg.ddl.create-type.as": "unmeasured", "pg.ddl.create-type.as-enum": "unmeasured", "pg.ddl.create-type.as-range-subtype": "unmeasured", - "pg.ddl.create-type.input-output": "unmeasured", + "pg.ddl.create-type.input-output": "not_translatable", "pg.ddl.create-type.name": "unmeasured", "pg.ddl.create-view": "matching", - "pg.ddl.drop-access-method": "unmeasured", + "pg.ddl.drop-access-method": "not_translatable", "pg.ddl.drop-aggregate": "unmeasured", "pg.ddl.drop-cast": "unmeasured", "pg.ddl.drop-collation": "unmeasured", - "pg.ddl.drop-conversion": "unmeasured", - "pg.ddl.drop-database": "unmeasured", + "pg.ddl.drop-conversion": "not_translatable", + "pg.ddl.drop-database": "not_translatable", "pg.ddl.drop-domain": "unmeasured", - "pg.ddl.drop-event-trigger": "unmeasured", - "pg.ddl.drop-extension": "unmeasured", - "pg.ddl.drop-foreign-data-wrapper": "unmeasured", - "pg.ddl.drop-foreign-table": "unmeasured", + "pg.ddl.drop-event-trigger": "not_translatable", + "pg.ddl.drop-extension": "not_translatable", + "pg.ddl.drop-foreign-data-wrapper": "not_translatable", + "pg.ddl.drop-foreign-table": "not_translatable", "pg.ddl.drop-function": "unmeasured", "pg.ddl.drop-index": "matching", - "pg.ddl.drop-language": "unmeasured", + "pg.ddl.drop-language": "not_translatable", "pg.ddl.drop-materialized-view": "unmeasured", "pg.ddl.drop-operator": "unmeasured", - "pg.ddl.drop-operator-class": "unmeasured", - "pg.ddl.drop-operator-family": "unmeasured", + "pg.ddl.drop-operator-class": "not_translatable", + "pg.ddl.drop-operator-family": "not_translatable", "pg.ddl.drop-procedure": "unmeasured", - "pg.ddl.drop-publication": "unmeasured", + "pg.ddl.drop-publication": "not_translatable", "pg.ddl.drop-routine": "unmeasured", "pg.ddl.drop-rule": "unmeasured", "pg.ddl.drop-schema": "matching", "pg.ddl.drop-sequence": "matching", - "pg.ddl.drop-server": "unmeasured", - "pg.ddl.drop-statistics": "unmeasured", - "pg.ddl.drop-subscription": "unmeasured", + "pg.ddl.drop-server": "not_translatable", + "pg.ddl.drop-statistics": "not_translatable", + "pg.ddl.drop-subscription": "not_translatable", "pg.ddl.drop-table": "matching", - "pg.ddl.drop-tablespace": "unmeasured", - "pg.ddl.drop-text-search-configuration": "unmeasured", - "pg.ddl.drop-text-search-dictionary": "unmeasured", - "pg.ddl.drop-text-search-parser": "unmeasured", - "pg.ddl.drop-text-search-template": "unmeasured", - "pg.ddl.drop-transform": "unmeasured", - "pg.ddl.drop-trigger": "unmeasured", + "pg.ddl.drop-tablespace": "not_translatable", + "pg.ddl.drop-text-search-configuration": "not_translatable", + "pg.ddl.drop-text-search-dictionary": "not_translatable", + "pg.ddl.drop-text-search-parser": "not_translatable", + "pg.ddl.drop-text-search-template": "not_translatable", + "pg.ddl.drop-transform": "not_translatable", + "pg.ddl.drop-trigger": "not_translatable", "pg.ddl.drop-type": "unmeasured", "pg.ddl.drop-view": "matching", - "pg.ddl.import-foreign-schema": "unmeasured", - "pg.dml.copy.from": "unmeasured", - "pg.dml.copy.pre-7-3-from": "unmeasured", - "pg.dml.copy.pre-7-3-to": "unmeasured", - "pg.dml.copy.pre-9-0-from": "unmeasured", - "pg.dml.copy.pre-9-0-to": "unmeasured", - "pg.dml.copy.to": "unmeasured", + "pg.ddl.import-foreign-schema": "not_translatable", + "pg.dml.copy.from": "not_translatable", + "pg.dml.copy.pre-7-3-from": "not_translatable", + "pg.dml.copy.pre-7-3-to": "not_translatable", + "pg.dml.copy.pre-9-0-from": "not_translatable", + "pg.dml.copy.pre-9-0-to": "not_translatable", + "pg.dml.copy.to": "not_translatable", "pg.dml.delete": "matching", "pg.dml.insert": "matching", "pg.dml.merge": "refused", @@ -3439,16 +3467,16 @@ "pg.expressions.datatype-oid.oid": "unmeasured", "pg.expressions.datatype-oid.regclass": "unmeasured", "pg.expressions.datatype-oid.regcollation": "unmeasured", - "pg.expressions.datatype-oid.regconfig": "unmeasured", - "pg.expressions.datatype-oid.regdictionary": "unmeasured", + "pg.expressions.datatype-oid.regconfig": "not_translatable", + "pg.expressions.datatype-oid.regdictionary": "not_translatable", "pg.expressions.datatype-oid.regnamespace": "unmeasured", "pg.expressions.datatype-oid.regoper": "unmeasured", "pg.expressions.datatype-oid.regoperator": "unmeasured", "pg.expressions.datatype-oid.regproc": "unmeasured", "pg.expressions.datatype-oid.regprocedure": "unmeasured", - "pg.expressions.datatype-oid.regrole": "unmeasured", + "pg.expressions.datatype-oid.regrole": "not_translatable", "pg.expressions.datatype-oid.regtype": "unmeasured", - "pg.expressions.datatype-pseudo.any": "unmeasured", + "pg.expressions.datatype-pseudo.any": "not_translatable", "pg.expressions.datatype-pseudo.anyarray": "unmeasured", "pg.expressions.datatype-pseudo.anycompatible": "unmeasured", "pg.expressions.datatype-pseudo.anycompatiblearray": "unmeasured", @@ -3460,18 +3488,18 @@ "pg.expressions.datatype-pseudo.anymultirange": "unmeasured", "pg.expressions.datatype-pseudo.anynonarray": "unmeasured", "pg.expressions.datatype-pseudo.anyrange": "unmeasured", - "pg.expressions.datatype-pseudo.cstring": "unmeasured", - "pg.expressions.datatype-pseudo.event-trigger": "unmeasured", - "pg.expressions.datatype-pseudo.fdw-handler": "unmeasured", - "pg.expressions.datatype-pseudo.index-am-handler": "unmeasured", - "pg.expressions.datatype-pseudo.internal": "unmeasured", - "pg.expressions.datatype-pseudo.language-handler": "unmeasured", - "pg.expressions.datatype-pseudo.pg-ddl-command": "unmeasured", + "pg.expressions.datatype-pseudo.cstring": "not_translatable", + "pg.expressions.datatype-pseudo.event-trigger": "not_translatable", + "pg.expressions.datatype-pseudo.fdw-handler": "not_translatable", + "pg.expressions.datatype-pseudo.index-am-handler": "not_translatable", + "pg.expressions.datatype-pseudo.internal": "not_translatable", + "pg.expressions.datatype-pseudo.language-handler": "not_translatable", + "pg.expressions.datatype-pseudo.pg-ddl-command": "not_translatable", "pg.expressions.datatype-pseudo.record": "unmeasured", - "pg.expressions.datatype-pseudo.table-am-handler": "unmeasured", - "pg.expressions.datatype-pseudo.trigger": "unmeasured", - "pg.expressions.datatype-pseudo.tsm-handler": "unmeasured", - "pg.expressions.datatype-pseudo.unknown": "unmeasured", + "pg.expressions.datatype-pseudo.table-am-handler": "not_translatable", + "pg.expressions.datatype-pseudo.trigger": "not_translatable", + "pg.expressions.datatype-pseudo.tsm-handler": "not_translatable", + "pg.expressions.datatype-pseudo.unknown": "not_translatable", "pg.expressions.datatype-pseudo.void": "unmeasured", "pg.expressions.datatype.bigint": "matching", "pg.expressions.datatype.bigserial": "matching", @@ -3515,10 +3543,10 @@ "pg.expressions.datatype.tsvector": "unmeasured", "pg.expressions.datatype.txid-snapshot": "unmeasured", "pg.expressions.datatype.uuid": "matching", - "pg.expressions.datatype.xml": "unmeasured", + "pg.expressions.datatype.xml": "not_translatable", "pg.expressions.datetime.at-local": "matching", "pg.expressions.datetime.at-time-zone": "matching", - "pg.expressions.datetime.op-minus": "unmet_obligations", + "pg.expressions.datetime.op-minus": "matching", "pg.expressions.datetime.op-plus": "matching", "pg.expressions.datetime.op-slash": "matching", "pg.expressions.datetime.op-star": "refused", @@ -3554,8 +3582,8 @@ "pg.expressions.geometry.op-slash": "unmeasured", "pg.expressions.geometry.op-star": "unmeasured", "pg.expressions.geometry.op-tilde-eq": "unmeasured", - "pg.expressions.info.op-at-gt": "unmeasured", - "pg.expressions.info.op-eq": "unmeasured", + "pg.expressions.info.op-at-gt": "not_translatable", + "pg.expressions.info.op-eq": "not_translatable", "pg.expressions.json.is-not-json-value-scalar-array": "matching", "pg.expressions.json.op-at-at": "refused", "pg.expressions.json.op-at-gt": "matching", @@ -3587,7 +3615,7 @@ "pg.expressions.math.op-amp": "matching", "pg.expressions.math.op-at": "matching", "pg.expressions.math.op-bar": "matching", - "pg.expressions.math.op-bar-bar-slash": "refused", + "pg.expressions.math.op-bar-bar-slash": "matching", "pg.expressions.math.op-bar-slash": "matching", "pg.expressions.math.op-caret": "refused", "pg.expressions.math.op-gt-gt": "matching", @@ -3697,114 +3725,114 @@ "pg.expressions.textsearch.op-bar-bar": "unmeasured", "pg.expressions.textsearch.op-lt-at": "unmeasured", "pg.expressions.textsearch.op-lt-minus-gt": "unmeasured", - "pg.expressions.xml.is-document": "unmeasured", - "pg.expressions.xml.is-not-document": "unmeasured", - "pg.functions.admin.brin-desummarize-range": "unmeasured", - "pg.functions.admin.brin-summarize-new-values": "unmeasured", - "pg.functions.admin.brin-summarize-range": "unmeasured", + "pg.expressions.xml.is-document": "not_translatable", + "pg.expressions.xml.is-not-document": "not_translatable", + "pg.functions.admin.brin-desummarize-range": "not_translatable", + "pg.functions.admin.brin-summarize-new-values": "not_translatable", + "pg.functions.admin.brin-summarize-range": "not_translatable", "pg.functions.admin.current-setting": "unmeasured", - "pg.functions.admin.gin-clean-pending-list": "unmeasured", - "pg.functions.admin.pg-advisory-lock": "unmeasured", - "pg.functions.admin.pg-advisory-lock-shared": "unmeasured", - "pg.functions.admin.pg-advisory-unlock": "unmeasured", - "pg.functions.admin.pg-advisory-unlock-all": "unmeasured", - "pg.functions.admin.pg-advisory-unlock-shared": "unmeasured", - "pg.functions.admin.pg-advisory-xact-lock": "unmeasured", - "pg.functions.admin.pg-advisory-xact-lock-shared": "unmeasured", - "pg.functions.admin.pg-backup-start": "unmeasured", - "pg.functions.admin.pg-backup-stop": "unmeasured", - "pg.functions.admin.pg-cancel-backend": "unmeasured", - "pg.functions.admin.pg-clear-attribute-stats": "unmeasured", - "pg.functions.admin.pg-clear-relation-stats": "unmeasured", - "pg.functions.admin.pg-collation-actual-version": "unmeasured", - "pg.functions.admin.pg-column-compression": "unmeasured", + "pg.functions.admin.gin-clean-pending-list": "not_translatable", + "pg.functions.admin.pg-advisory-lock": "not_translatable", + "pg.functions.admin.pg-advisory-lock-shared": "not_translatable", + "pg.functions.admin.pg-advisory-unlock": "not_translatable", + "pg.functions.admin.pg-advisory-unlock-all": "not_translatable", + "pg.functions.admin.pg-advisory-unlock-shared": "not_translatable", + "pg.functions.admin.pg-advisory-xact-lock": "not_translatable", + "pg.functions.admin.pg-advisory-xact-lock-shared": "not_translatable", + "pg.functions.admin.pg-backup-start": "not_translatable", + "pg.functions.admin.pg-backup-stop": "not_translatable", + "pg.functions.admin.pg-cancel-backend": "not_translatable", + "pg.functions.admin.pg-clear-attribute-stats": "not_translatable", + "pg.functions.admin.pg-clear-relation-stats": "not_translatable", + "pg.functions.admin.pg-collation-actual-version": "not_translatable", + "pg.functions.admin.pg-column-compression": "not_translatable", "pg.functions.admin.pg-column-size": "unmeasured", - "pg.functions.admin.pg-column-toast-chunk-id": "unmeasured", - "pg.functions.admin.pg-copy-logical-replication-slot": "unmeasured", - "pg.functions.admin.pg-copy-physical-replication-slot": "unmeasured", - "pg.functions.admin.pg-create-logical-replication-slot": "unmeasured", - "pg.functions.admin.pg-create-physical-replication-slot": "unmeasured", - "pg.functions.admin.pg-create-restore-point": "unmeasured", - "pg.functions.admin.pg-current-wal-flush-lsn": "unmeasured", - "pg.functions.admin.pg-current-wal-insert-lsn": "unmeasured", - "pg.functions.admin.pg-current-wal-lsn": "unmeasured", - "pg.functions.admin.pg-database-collation-actual-version": "unmeasured", - "pg.functions.admin.pg-database-size": "unmeasured", - "pg.functions.admin.pg-drop-replication-slot": "unmeasured", - "pg.functions.admin.pg-export-snapshot": "unmeasured", - "pg.functions.admin.pg-filenode-relation": "unmeasured", - "pg.functions.admin.pg-get-wal-replay-pause-state": "unmeasured", - "pg.functions.admin.pg-get-wal-resource-managers": "unmeasured", - "pg.functions.admin.pg-import-system-collations": "unmeasured", - "pg.functions.admin.pg-indexes-size": "unmeasured", - "pg.functions.admin.pg-is-in-recovery": "unmeasured", - "pg.functions.admin.pg-is-wal-replay-paused": "unmeasured", - "pg.functions.admin.pg-last-wal-receive-lsn": "unmeasured", - "pg.functions.admin.pg-last-wal-replay-lsn": "unmeasured", - "pg.functions.admin.pg-last-xact-replay-timestamp": "unmeasured", - "pg.functions.admin.pg-log-backend-memory-contexts": "unmeasured", - "pg.functions.admin.pg-log-standby-snapshot": "unmeasured", - "pg.functions.admin.pg-logical-emit-message": "unmeasured", - "pg.functions.admin.pg-logical-slot-get-binary-changes": "unmeasured", - "pg.functions.admin.pg-logical-slot-get-changes": "unmeasured", - "pg.functions.admin.pg-logical-slot-peek-binary-changes": "unmeasured", - "pg.functions.admin.pg-logical-slot-peek-changes": "unmeasured", - "pg.functions.admin.pg-ls-archive-statusdir": "unmeasured", - "pg.functions.admin.pg-ls-dir": "unmeasured", - "pg.functions.admin.pg-ls-logdir": "unmeasured", - "pg.functions.admin.pg-ls-logicalmapdir": "unmeasured", - "pg.functions.admin.pg-ls-logicalsnapdir": "unmeasured", - "pg.functions.admin.pg-ls-replslotdir": "unmeasured", - "pg.functions.admin.pg-ls-summariesdir": "unmeasured", - "pg.functions.admin.pg-ls-tmpdir": "unmeasured", - "pg.functions.admin.pg-ls-waldir": "unmeasured", - "pg.functions.admin.pg-partition-ancestors": "unmeasured", - "pg.functions.admin.pg-partition-root": "unmeasured", - "pg.functions.admin.pg-partition-tree": "unmeasured", - "pg.functions.admin.pg-promote": "unmeasured", - "pg.functions.admin.pg-read-binary-file": "unmeasured", - "pg.functions.admin.pg-read-file": "unmeasured", - "pg.functions.admin.pg-relation-filenode": "unmeasured", - "pg.functions.admin.pg-relation-filepath": "unmeasured", - "pg.functions.admin.pg-relation-size": "unmeasured", - "pg.functions.admin.pg-reload-conf": "unmeasured", - "pg.functions.admin.pg-replication-origin-advance": "unmeasured", - "pg.functions.admin.pg-replication-origin-create": "unmeasured", - "pg.functions.admin.pg-replication-origin-drop": "unmeasured", - "pg.functions.admin.pg-replication-origin-oid": "unmeasured", - "pg.functions.admin.pg-replication-origin-progress": "unmeasured", - "pg.functions.admin.pg-replication-origin-session-is-setup": "unmeasured", - "pg.functions.admin.pg-replication-origin-session-progress": "unmeasured", - "pg.functions.admin.pg-replication-origin-session-reset": "unmeasured", - "pg.functions.admin.pg-replication-origin-session-setup": "unmeasured", - "pg.functions.admin.pg-replication-origin-xact-reset": "unmeasured", - "pg.functions.admin.pg-replication-origin-xact-setup": "unmeasured", - "pg.functions.admin.pg-replication-slot-advance": "unmeasured", - "pg.functions.admin.pg-restore-attribute-stats": "unmeasured", - "pg.functions.admin.pg-restore-relation-stats": "unmeasured", - "pg.functions.admin.pg-rotate-logfile": "unmeasured", + "pg.functions.admin.pg-column-toast-chunk-id": "not_translatable", + "pg.functions.admin.pg-copy-logical-replication-slot": "not_translatable", + "pg.functions.admin.pg-copy-physical-replication-slot": "not_translatable", + "pg.functions.admin.pg-create-logical-replication-slot": "not_translatable", + "pg.functions.admin.pg-create-physical-replication-slot": "not_translatable", + "pg.functions.admin.pg-create-restore-point": "not_translatable", + "pg.functions.admin.pg-current-wal-flush-lsn": "not_translatable", + "pg.functions.admin.pg-current-wal-insert-lsn": "not_translatable", + "pg.functions.admin.pg-current-wal-lsn": "not_translatable", + "pg.functions.admin.pg-database-collation-actual-version": "not_translatable", + "pg.functions.admin.pg-database-size": "not_translatable", + "pg.functions.admin.pg-drop-replication-slot": "not_translatable", + "pg.functions.admin.pg-export-snapshot": "not_translatable", + "pg.functions.admin.pg-filenode-relation": "not_translatable", + "pg.functions.admin.pg-get-wal-replay-pause-state": "not_translatable", + "pg.functions.admin.pg-get-wal-resource-managers": "not_translatable", + "pg.functions.admin.pg-import-system-collations": "not_translatable", + "pg.functions.admin.pg-indexes-size": "not_translatable", + "pg.functions.admin.pg-is-in-recovery": "not_translatable", + "pg.functions.admin.pg-is-wal-replay-paused": "not_translatable", + "pg.functions.admin.pg-last-wal-receive-lsn": "not_translatable", + "pg.functions.admin.pg-last-wal-replay-lsn": "not_translatable", + "pg.functions.admin.pg-last-xact-replay-timestamp": "not_translatable", + "pg.functions.admin.pg-log-backend-memory-contexts": "not_translatable", + "pg.functions.admin.pg-log-standby-snapshot": "not_translatable", + "pg.functions.admin.pg-logical-emit-message": "not_translatable", + "pg.functions.admin.pg-logical-slot-get-binary-changes": "not_translatable", + "pg.functions.admin.pg-logical-slot-get-changes": "not_translatable", + "pg.functions.admin.pg-logical-slot-peek-binary-changes": "not_translatable", + "pg.functions.admin.pg-logical-slot-peek-changes": "not_translatable", + "pg.functions.admin.pg-ls-archive-statusdir": "not_translatable", + "pg.functions.admin.pg-ls-dir": "not_translatable", + "pg.functions.admin.pg-ls-logdir": "not_translatable", + "pg.functions.admin.pg-ls-logicalmapdir": "not_translatable", + "pg.functions.admin.pg-ls-logicalsnapdir": "not_translatable", + "pg.functions.admin.pg-ls-replslotdir": "not_translatable", + "pg.functions.admin.pg-ls-summariesdir": "not_translatable", + "pg.functions.admin.pg-ls-tmpdir": "not_translatable", + "pg.functions.admin.pg-ls-waldir": "not_translatable", + "pg.functions.admin.pg-partition-ancestors": "not_translatable", + "pg.functions.admin.pg-partition-root": "not_translatable", + "pg.functions.admin.pg-partition-tree": "not_translatable", + "pg.functions.admin.pg-promote": "not_translatable", + "pg.functions.admin.pg-read-binary-file": "not_translatable", + "pg.functions.admin.pg-read-file": "not_translatable", + "pg.functions.admin.pg-relation-filenode": "not_translatable", + "pg.functions.admin.pg-relation-filepath": "not_translatable", + "pg.functions.admin.pg-relation-size": "not_translatable", + "pg.functions.admin.pg-reload-conf": "not_translatable", + "pg.functions.admin.pg-replication-origin-advance": "not_translatable", + "pg.functions.admin.pg-replication-origin-create": "not_translatable", + "pg.functions.admin.pg-replication-origin-drop": "not_translatable", + "pg.functions.admin.pg-replication-origin-oid": "not_translatable", + "pg.functions.admin.pg-replication-origin-progress": "not_translatable", + "pg.functions.admin.pg-replication-origin-session-is-setup": "not_translatable", + "pg.functions.admin.pg-replication-origin-session-progress": "not_translatable", + "pg.functions.admin.pg-replication-origin-session-reset": "not_translatable", + "pg.functions.admin.pg-replication-origin-session-setup": "not_translatable", + "pg.functions.admin.pg-replication-origin-xact-reset": "not_translatable", + "pg.functions.admin.pg-replication-origin-xact-setup": "not_translatable", + "pg.functions.admin.pg-replication-slot-advance": "not_translatable", + "pg.functions.admin.pg-restore-attribute-stats": "not_translatable", + "pg.functions.admin.pg-restore-relation-stats": "not_translatable", + "pg.functions.admin.pg-rotate-logfile": "not_translatable", "pg.functions.admin.pg-size-bytes": "unmeasured", "pg.functions.admin.pg-size-pretty": "unmeasured", "pg.functions.admin.pg-split-walfile-name": "unmeasured", - "pg.functions.admin.pg-stat-file": "unmeasured", - "pg.functions.admin.pg-switch-wal": "unmeasured", - "pg.functions.admin.pg-sync-replication-slots": "unmeasured", - "pg.functions.admin.pg-table-size": "unmeasured", - "pg.functions.admin.pg-tablespace-size": "unmeasured", - "pg.functions.admin.pg-terminate-backend": "unmeasured", - "pg.functions.admin.pg-total-relation-size": "unmeasured", - "pg.functions.admin.pg-try-advisory-lock": "unmeasured", - "pg.functions.admin.pg-try-advisory-lock-shared": "unmeasured", - "pg.functions.admin.pg-try-advisory-xact-lock": "unmeasured", - "pg.functions.admin.pg-try-advisory-xact-lock-shared": "unmeasured", + "pg.functions.admin.pg-stat-file": "not_translatable", + "pg.functions.admin.pg-switch-wal": "not_translatable", + "pg.functions.admin.pg-sync-replication-slots": "not_translatable", + "pg.functions.admin.pg-table-size": "not_translatable", + "pg.functions.admin.pg-tablespace-size": "not_translatable", + "pg.functions.admin.pg-terminate-backend": "not_translatable", + "pg.functions.admin.pg-total-relation-size": "not_translatable", + "pg.functions.admin.pg-try-advisory-lock": "not_translatable", + "pg.functions.admin.pg-try-advisory-lock-shared": "not_translatable", + "pg.functions.admin.pg-try-advisory-xact-lock": "not_translatable", + "pg.functions.admin.pg-try-advisory-xact-lock-shared": "not_translatable", "pg.functions.admin.pg-wal-lsn-diff": "unmeasured", - "pg.functions.admin.pg-wal-replay-pause": "unmeasured", - "pg.functions.admin.pg-wal-replay-resume": "unmeasured", - "pg.functions.admin.pg-walfile-name": "unmeasured", - "pg.functions.admin.pg-walfile-name-offset": "unmeasured", + "pg.functions.admin.pg-wal-replay-pause": "not_translatable", + "pg.functions.admin.pg-wal-replay-resume": "not_translatable", + "pg.functions.admin.pg-walfile-name": "not_translatable", + "pg.functions.admin.pg-walfile-name-offset": "not_translatable", "pg.functions.admin.set-config": "unmeasured", - "pg.functions.aggregate.any-value": "refused", - "pg.functions.aggregate.array-agg-order-by": "unmeasured", + "pg.functions.aggregate.any-value": "matching", + "pg.functions.aggregate.array-agg-order-by": "matching", "pg.functions.aggregate.avg": "refused", "pg.functions.aggregate.bit-and": "matching", "pg.functions.aggregate.bit-or": "matching", @@ -3819,20 +3847,20 @@ "pg.functions.aggregate.dense-rank-within-group-order-by": "matching", "pg.functions.aggregate.every": "matching", "pg.functions.aggregate.grouping": "unmeasured", - "pg.functions.aggregate.json-agg-order-by": "unmeasured", - "pg.functions.aggregate.json-agg-strict": "refused", + "pg.functions.aggregate.json-agg-order-by": "matching", + "pg.functions.aggregate.json-agg-strict": "matching", "pg.functions.aggregate.json-arrayagg": "unmeasured", - "pg.functions.aggregate.json-object-agg-order-by": "unmeasured", - "pg.functions.aggregate.json-object-agg-strict": "refused", - "pg.functions.aggregate.json-object-agg-unique": "refused", - "pg.functions.aggregate.json-object-agg-unique-strict": "refused", + "pg.functions.aggregate.json-object-agg-order-by": "matching", + "pg.functions.aggregate.json-object-agg-strict": "matching", + "pg.functions.aggregate.json-object-agg-unique": "matching", + "pg.functions.aggregate.json-object-agg-unique-strict": "matching", "pg.functions.aggregate.json-objectagg": "unmeasured", - "pg.functions.aggregate.jsonb-agg-order-by": "unmeasured", - "pg.functions.aggregate.jsonb-agg-strict": "refused", - "pg.functions.aggregate.jsonb-object-agg-order-by": "unmeasured", - "pg.functions.aggregate.jsonb-object-agg-strict": "refused", - "pg.functions.aggregate.jsonb-object-agg-unique": "refused", - "pg.functions.aggregate.jsonb-object-agg-unique-strict": "refused", + "pg.functions.aggregate.jsonb-agg-order-by": "matching", + "pg.functions.aggregate.jsonb-agg-strict": "matching", + "pg.functions.aggregate.jsonb-object-agg-order-by": "matching", + "pg.functions.aggregate.jsonb-object-agg-strict": "matching", + "pg.functions.aggregate.jsonb-object-agg-unique": "matching", + "pg.functions.aggregate.jsonb-object-agg-unique-strict": "matching", "pg.functions.aggregate.max": "matching", "pg.functions.aggregate.min": "matching", "pg.functions.aggregate.mode-within-group-order-by": "matching", @@ -3854,8 +3882,8 @@ "pg.functions.aggregate.stddev": "refused", "pg.functions.aggregate.stddev-pop": "refused", "pg.functions.aggregate.stddev-samp": "refused", - "pg.functions.aggregate.string-agg": "refused", - "pg.functions.aggregate.string-agg-order-by": "refused", + "pg.functions.aggregate.string-agg": "matching", + "pg.functions.aggregate.string-agg-order-by": "matching", "pg.functions.aggregate.sum": "matching", "pg.functions.aggregate.var-pop": "refused", "pg.functions.aggregate.var-samp": "refused", @@ -3885,9 +3913,9 @@ "pg.functions.binarystring.bit-count": "matching", "pg.functions.binarystring.bit-length": "matching", "pg.functions.binarystring.btrim": "matching", - "pg.functions.binarystring.convert": "refused", - "pg.functions.binarystring.convert-from": "refused", - "pg.functions.binarystring.convert-to": "refused", + "pg.functions.binarystring.convert": "matching", + "pg.functions.binarystring.convert-from": "matching", + "pg.functions.binarystring.convert-to": "matching", "pg.functions.binarystring.crc32": "refused", "pg.functions.binarystring.crc32c": "refused", "pg.functions.binarystring.decode": "matching", @@ -3909,7 +3937,7 @@ "pg.functions.binarystring.sha384": "refused", "pg.functions.binarystring.sha512": "refused", "pg.functions.binarystring.substr": "matching", - "pg.functions.binarystring.substring": "refused", + "pg.functions.binarystring.substring": "matching", "pg.functions.binarystring.trim": "matching", "pg.functions.binarystring.trim-from": "matching", "pg.functions.bitstring.bit-count": "matching", @@ -3920,56 +3948,56 @@ "pg.functions.bitstring.overlay-placing-from": "matching", "pg.functions.bitstring.position-in": "matching", "pg.functions.bitstring.set-bit": "matching", - "pg.functions.bitstring.substring": "refused", - "pg.functions.comparison.num-nonnulls": "refused", - "pg.functions.comparison.num-nulls": "refused", + "pg.functions.bitstring.substring": "matching", + "pg.functions.comparison.num-nonnulls": "matching", + "pg.functions.comparison.num-nulls": "matching", "pg.functions.conditional.coalesce": "matching", "pg.functions.conditional.greatest": "matching", "pg.functions.conditional.least": "matching", "pg.functions.conditional.nullif": "matching", - "pg.functions.datatype-xml.xmlparse": "unmeasured", + "pg.functions.datatype-xml.xmlparse": "not_translatable", "pg.functions.datatype-xml.xmlserialize-as": "unmeasured", "pg.functions.datetime.age": "unmeasured", - "pg.functions.datetime.clock-timestamp": "unmeasured", - "pg.functions.datetime.current-date-noparens": "unmeasured", - "pg.functions.datetime.current-time": "unmeasured", + "pg.functions.datetime.clock-timestamp": "not_translatable", + "pg.functions.datetime.current-date-noparens": "not_translatable", + "pg.functions.datetime.current-time": "not_translatable", "pg.functions.datetime.current-time-noparens": "unmeasured", - "pg.functions.datetime.current-timestamp": "unmeasured", + "pg.functions.datetime.current-timestamp": "not_translatable", "pg.functions.datetime.current-timestamp-noparens": "unmeasured", "pg.functions.datetime.date-add": "matching", "pg.functions.datetime.date-bin": "matching", "pg.functions.datetime.date-part": "matching", "pg.functions.datetime.date-subtract": "matching", "pg.functions.datetime.date-trunc": "matching", - "pg.functions.datetime.extract": "refused", + "pg.functions.datetime.extract": "matching", "pg.functions.datetime.isfinite": "matching", "pg.functions.datetime.justify-days": "matching", "pg.functions.datetime.justify-hours": "matching", "pg.functions.datetime.justify-interval": "matching", - "pg.functions.datetime.localtime": "unmeasured", + "pg.functions.datetime.localtime": "not_translatable", "pg.functions.datetime.localtime-noparens": "unmeasured", - "pg.functions.datetime.localtimestamp": "unmeasured", + "pg.functions.datetime.localtimestamp": "not_translatable", "pg.functions.datetime.localtimestamp-noparens": "unmeasured", "pg.functions.datetime.make-date": "matching", "pg.functions.datetime.make-interval": "matching", "pg.functions.datetime.make-time": "matching", "pg.functions.datetime.make-timestamp": "matching", "pg.functions.datetime.make-timestamptz": "matching", - "pg.functions.datetime.now": "unmeasured", + "pg.functions.datetime.now": "not_translatable", "pg.functions.datetime.pg-sleep": "unmeasured", "pg.functions.datetime.pg-sleep-for": "unmeasured", "pg.functions.datetime.pg-sleep-until": "unmeasured", - "pg.functions.datetime.statement-timestamp": "unmeasured", - "pg.functions.datetime.timeofday": "unmeasured", + "pg.functions.datetime.statement-timestamp": "not_translatable", + "pg.functions.datetime.timeofday": "not_translatable", "pg.functions.datetime.to-timestamp": "refused", - "pg.functions.datetime.transaction-timestamp": "unmeasured", + "pg.functions.datetime.transaction-timestamp": "not_translatable", "pg.functions.enum.enum-first": "unmeasured", "pg.functions.enum.enum-last": "unmeasured", "pg.functions.enum.enum-range": "unmeasured", - "pg.functions.event-triggers.pg-event-trigger-ddl-commands": "unmeasured", - "pg.functions.event-triggers.pg-event-trigger-dropped-objects": "unmeasured", - "pg.functions.event-triggers.pg-event-trigger-table-rewrite-oid": "unmeasured", - "pg.functions.event-triggers.pg-event-trigger-table-rewrite-reason": "unmeasured", + "pg.functions.event-triggers.pg-event-trigger-ddl-commands": "not_translatable", + "pg.functions.event-triggers.pg-event-trigger-dropped-objects": "not_translatable", + "pg.functions.event-triggers.pg-event-trigger-table-rewrite-oid": "not_translatable", + "pg.functions.event-triggers.pg-event-trigger-table-rewrite-reason": "not_translatable", "pg.functions.formatting.to-char": "refused", "pg.functions.formatting.to-date": "refused", "pg.functions.formatting.to-number": "refused", @@ -3984,7 +4012,7 @@ "pg.functions.geometry.height": "unmeasured", "pg.functions.geometry.isclosed": "unmeasured", "pg.functions.geometry.isopen": "unmeasured", - "pg.functions.geometry.length": "no_obligations", + "pg.functions.geometry.length": "syntax_only", "pg.functions.geometry.line": "unmeasured", "pg.functions.geometry.lseg": "unmeasured", "pg.functions.geometry.npoints": "unmeasured", @@ -3996,128 +4024,128 @@ "pg.functions.geometry.radius": "unmeasured", "pg.functions.geometry.slope": "unmeasured", "pg.functions.geometry.width": "unmeasured", - "pg.functions.info.acldefault": "unmeasured", - "pg.functions.info.aclexplode": "unmeasured", - "pg.functions.info.age": "unmeasured", + "pg.functions.info.acldefault": "not_translatable", + "pg.functions.info.aclexplode": "not_translatable", + "pg.functions.info.age": "not_translatable", "pg.functions.info.col-description": "unmeasured", "pg.functions.info.collation-for": "unmeasured", - "pg.functions.info.current-catalog-noparens": "unmeasured", - "pg.functions.info.current-database": "unmeasured", - "pg.functions.info.current-query": "unmeasured", - "pg.functions.info.current-role-noparens": "unmeasured", + "pg.functions.info.current-catalog-noparens": "not_translatable", + "pg.functions.info.current-database": "not_translatable", + "pg.functions.info.current-query": "not_translatable", + "pg.functions.info.current-role-noparens": "not_translatable", "pg.functions.info.current-schema": "unmeasured", "pg.functions.info.current-schema-noparens": "unmeasured", "pg.functions.info.current-schemas": "unmeasured", - "pg.functions.info.current-user-noparens": "unmeasured", + "pg.functions.info.current-user-noparens": "not_translatable", "pg.functions.info.format-type": "unmeasured", - "pg.functions.info.has-any-column-privilege": "unmeasured", - "pg.functions.info.has-column-privilege": "unmeasured", - "pg.functions.info.has-database-privilege": "unmeasured", - "pg.functions.info.has-foreign-data-wrapper-privilege": "unmeasured", - "pg.functions.info.has-function-privilege": "unmeasured", - "pg.functions.info.has-language-privilege": "unmeasured", - "pg.functions.info.has-largeobject-privilege": "unmeasured", - "pg.functions.info.has-parameter-privilege": "unmeasured", - "pg.functions.info.has-schema-privilege": "unmeasured", - "pg.functions.info.has-sequence-privilege": "unmeasured", - "pg.functions.info.has-server-privilege": "unmeasured", - "pg.functions.info.has-table-privilege": "unmeasured", - "pg.functions.info.has-tablespace-privilege": "unmeasured", - "pg.functions.info.has-type-privilege": "unmeasured", - "pg.functions.info.icu-unicode-version": "unmeasured", - "pg.functions.info.inet-client-addr": "unmeasured", - "pg.functions.info.inet-client-port": "unmeasured", - "pg.functions.info.inet-server-addr": "unmeasured", - "pg.functions.info.inet-server-port": "unmeasured", - "pg.functions.info.makeaclitem": "unmeasured", - "pg.functions.info.mxid-age": "unmeasured", + "pg.functions.info.has-any-column-privilege": "not_translatable", + "pg.functions.info.has-column-privilege": "not_translatable", + "pg.functions.info.has-database-privilege": "not_translatable", + "pg.functions.info.has-foreign-data-wrapper-privilege": "not_translatable", + "pg.functions.info.has-function-privilege": "not_translatable", + "pg.functions.info.has-language-privilege": "not_translatable", + "pg.functions.info.has-largeobject-privilege": "not_translatable", + "pg.functions.info.has-parameter-privilege": "not_translatable", + "pg.functions.info.has-schema-privilege": "not_translatable", + "pg.functions.info.has-sequence-privilege": "not_translatable", + "pg.functions.info.has-server-privilege": "not_translatable", + "pg.functions.info.has-table-privilege": "not_translatable", + "pg.functions.info.has-tablespace-privilege": "not_translatable", + "pg.functions.info.has-type-privilege": "not_translatable", + "pg.functions.info.icu-unicode-version": "not_translatable", + "pg.functions.info.inet-client-addr": "not_translatable", + "pg.functions.info.inet-client-port": "not_translatable", + "pg.functions.info.inet-server-addr": "not_translatable", + "pg.functions.info.inet-server-port": "not_translatable", + "pg.functions.info.makeaclitem": "not_translatable", + "pg.functions.info.mxid-age": "not_translatable", "pg.functions.info.obj-description": "unmeasured", - "pg.functions.info.pg-available-wal-summaries": "unmeasured", - "pg.functions.info.pg-backend-pid": "unmeasured", + "pg.functions.info.pg-available-wal-summaries": "not_translatable", + "pg.functions.info.pg-backend-pid": "not_translatable", "pg.functions.info.pg-basetype": "unmeasured", - "pg.functions.info.pg-blocking-pids": "unmeasured", + "pg.functions.info.pg-blocking-pids": "not_translatable", "pg.functions.info.pg-char-to-encoding": "unmeasured", "pg.functions.info.pg-collation-is-visible": "unmeasured", - "pg.functions.info.pg-conf-load-time": "unmeasured", - "pg.functions.info.pg-control-checkpoint": "unmeasured", - "pg.functions.info.pg-control-init": "unmeasured", - "pg.functions.info.pg-control-recovery": "unmeasured", - "pg.functions.info.pg-control-system": "unmeasured", - "pg.functions.info.pg-conversion-is-visible": "unmeasured", - "pg.functions.info.pg-current-logfile": "unmeasured", - "pg.functions.info.pg-current-snapshot": "unmeasured", - "pg.functions.info.pg-current-xact-id": "unmeasured", - "pg.functions.info.pg-current-xact-id-if-assigned": "unmeasured", - "pg.functions.info.pg-describe-object": "unmeasured", + "pg.functions.info.pg-conf-load-time": "not_translatable", + "pg.functions.info.pg-control-checkpoint": "not_translatable", + "pg.functions.info.pg-control-init": "not_translatable", + "pg.functions.info.pg-control-recovery": "not_translatable", + "pg.functions.info.pg-control-system": "not_translatable", + "pg.functions.info.pg-conversion-is-visible": "not_translatable", + "pg.functions.info.pg-current-logfile": "not_translatable", + "pg.functions.info.pg-current-snapshot": "not_translatable", + "pg.functions.info.pg-current-xact-id": "not_translatable", + "pg.functions.info.pg-current-xact-id-if-assigned": "not_translatable", + "pg.functions.info.pg-describe-object": "not_translatable", "pg.functions.info.pg-encoding-to-char": "unmeasured", "pg.functions.info.pg-function-is-visible": "unmeasured", - "pg.functions.info.pg-get-acl": "unmeasured", - "pg.functions.info.pg-get-catalog-foreign-keys": "unmeasured", - "pg.functions.info.pg-get-constraintdef": "unmeasured", - "pg.functions.info.pg-get-expr": "unmeasured", - "pg.functions.info.pg-get-function-arguments": "unmeasured", - "pg.functions.info.pg-get-function-identity-arguments": "unmeasured", - "pg.functions.info.pg-get-function-result": "unmeasured", - "pg.functions.info.pg-get-functiondef": "unmeasured", - "pg.functions.info.pg-get-indexdef": "unmeasured", - "pg.functions.info.pg-get-keywords": "unmeasured", - "pg.functions.info.pg-get-loaded-modules": "unmeasured", - "pg.functions.info.pg-get-multixact-members": "unmeasured", - "pg.functions.info.pg-get-object-address": "unmeasured", - "pg.functions.info.pg-get-partition-constraintdef": "unmeasured", - "pg.functions.info.pg-get-partkeydef": "unmeasured", - "pg.functions.info.pg-get-ruledef": "unmeasured", + "pg.functions.info.pg-get-acl": "not_translatable", + "pg.functions.info.pg-get-catalog-foreign-keys": "not_translatable", + "pg.functions.info.pg-get-constraintdef": "not_translatable", + "pg.functions.info.pg-get-expr": "not_translatable", + "pg.functions.info.pg-get-function-arguments": "not_translatable", + "pg.functions.info.pg-get-function-identity-arguments": "not_translatable", + "pg.functions.info.pg-get-function-result": "not_translatable", + "pg.functions.info.pg-get-functiondef": "not_translatable", + "pg.functions.info.pg-get-indexdef": "not_translatable", + "pg.functions.info.pg-get-keywords": "not_translatable", + "pg.functions.info.pg-get-loaded-modules": "not_translatable", + "pg.functions.info.pg-get-multixact-members": "not_translatable", + "pg.functions.info.pg-get-object-address": "not_translatable", + "pg.functions.info.pg-get-partition-constraintdef": "not_translatable", + "pg.functions.info.pg-get-partkeydef": "not_translatable", + "pg.functions.info.pg-get-ruledef": "not_translatable", "pg.functions.info.pg-get-serial-sequence": "unmeasured", - "pg.functions.info.pg-get-statisticsobjdef": "unmeasured", - "pg.functions.info.pg-get-triggerdef": "unmeasured", - "pg.functions.info.pg-get-userbyid": "unmeasured", - "pg.functions.info.pg-get-viewdef": "unmeasured", - "pg.functions.info.pg-get-wal-summarizer-state": "unmeasured", - "pg.functions.info.pg-has-role": "unmeasured", - "pg.functions.info.pg-identify-object": "unmeasured", - "pg.functions.info.pg-identify-object-as-address": "unmeasured", - "pg.functions.info.pg-index-column-has-property": "unmeasured", - "pg.functions.info.pg-index-has-property": "unmeasured", - "pg.functions.info.pg-indexam-has-property": "unmeasured", + "pg.functions.info.pg-get-statisticsobjdef": "not_translatable", + "pg.functions.info.pg-get-triggerdef": "not_translatable", + "pg.functions.info.pg-get-userbyid": "not_translatable", + "pg.functions.info.pg-get-viewdef": "not_translatable", + "pg.functions.info.pg-get-wal-summarizer-state": "not_translatable", + "pg.functions.info.pg-has-role": "not_translatable", + "pg.functions.info.pg-identify-object": "not_translatable", + "pg.functions.info.pg-identify-object-as-address": "not_translatable", + "pg.functions.info.pg-index-column-has-property": "not_translatable", + "pg.functions.info.pg-index-has-property": "not_translatable", + "pg.functions.info.pg-indexam-has-property": "not_translatable", "pg.functions.info.pg-input-error-info": "unmeasured", "pg.functions.info.pg-input-is-valid": "unmeasured", - "pg.functions.info.pg-is-other-temp-schema": "unmeasured", - "pg.functions.info.pg-jit-available": "unmeasured", - "pg.functions.info.pg-last-committed-xact": "unmeasured", - "pg.functions.info.pg-listening-channels": "unmeasured", - "pg.functions.info.pg-my-temp-schema": "unmeasured", - "pg.functions.info.pg-notification-queue-usage": "unmeasured", - "pg.functions.info.pg-numa-available": "unmeasured", - "pg.functions.info.pg-opclass-is-visible": "unmeasured", + "pg.functions.info.pg-is-other-temp-schema": "not_translatable", + "pg.functions.info.pg-jit-available": "not_translatable", + "pg.functions.info.pg-last-committed-xact": "not_translatable", + "pg.functions.info.pg-listening-channels": "not_translatable", + "pg.functions.info.pg-my-temp-schema": "not_translatable", + "pg.functions.info.pg-notification-queue-usage": "not_translatable", + "pg.functions.info.pg-numa-available": "not_translatable", + "pg.functions.info.pg-opclass-is-visible": "not_translatable", "pg.functions.info.pg-operator-is-visible": "unmeasured", - "pg.functions.info.pg-opfamily-is-visible": "unmeasured", + "pg.functions.info.pg-opfamily-is-visible": "not_translatable", "pg.functions.info.pg-options-to-table": "unmeasured", - "pg.functions.info.pg-postmaster-start-time": "unmeasured", - "pg.functions.info.pg-safe-snapshot-blocking-pids": "unmeasured", - "pg.functions.info.pg-settings-get-flags": "unmeasured", + "pg.functions.info.pg-postmaster-start-time": "not_translatable", + "pg.functions.info.pg-safe-snapshot-blocking-pids": "not_translatable", + "pg.functions.info.pg-settings-get-flags": "not_translatable", "pg.functions.info.pg-snapshot-xip": "unmeasured", "pg.functions.info.pg-snapshot-xmax": "unmeasured", "pg.functions.info.pg-snapshot-xmin": "unmeasured", - "pg.functions.info.pg-statistics-obj-is-visible": "unmeasured", + "pg.functions.info.pg-statistics-obj-is-visible": "not_translatable", "pg.functions.info.pg-table-is-visible": "unmeasured", - "pg.functions.info.pg-tablespace-databases": "unmeasured", - "pg.functions.info.pg-tablespace-location": "unmeasured", - "pg.functions.info.pg-trigger-depth": "unmeasured", - "pg.functions.info.pg-ts-config-is-visible": "unmeasured", - "pg.functions.info.pg-ts-dict-is-visible": "unmeasured", - "pg.functions.info.pg-ts-parser-is-visible": "unmeasured", - "pg.functions.info.pg-ts-template-is-visible": "unmeasured", + "pg.functions.info.pg-tablespace-databases": "not_translatable", + "pg.functions.info.pg-tablespace-location": "not_translatable", + "pg.functions.info.pg-trigger-depth": "not_translatable", + "pg.functions.info.pg-ts-config-is-visible": "not_translatable", + "pg.functions.info.pg-ts-dict-is-visible": "not_translatable", + "pg.functions.info.pg-ts-parser-is-visible": "not_translatable", + "pg.functions.info.pg-ts-template-is-visible": "not_translatable", "pg.functions.info.pg-type-is-visible": "unmeasured", "pg.functions.info.pg-typeof": "matching", "pg.functions.info.pg-visible-in-snapshot": "unmeasured", - "pg.functions.info.pg-wal-summary-contents": "unmeasured", - "pg.functions.info.pg-xact-commit-timestamp": "unmeasured", - "pg.functions.info.pg-xact-commit-timestamp-origin": "unmeasured", - "pg.functions.info.pg-xact-status": "unmeasured", - "pg.functions.info.row-security-active": "unmeasured", - "pg.functions.info.session-user-noparens": "unmeasured", - "pg.functions.info.shobj-description": "unmeasured", - "pg.functions.info.system-user-noparens": "unmeasured", + "pg.functions.info.pg-wal-summary-contents": "not_translatable", + "pg.functions.info.pg-xact-commit-timestamp": "not_translatable", + "pg.functions.info.pg-xact-commit-timestamp-origin": "not_translatable", + "pg.functions.info.pg-xact-status": "not_translatable", + "pg.functions.info.row-security-active": "not_translatable", + "pg.functions.info.session-user-noparens": "not_translatable", + "pg.functions.info.shobj-description": "not_translatable", + "pg.functions.info.system-user-noparens": "not_translatable", "pg.functions.info.to-regclass": "unmeasured", "pg.functions.info.to-regcollation": "unmeasured", "pg.functions.info.to-regnamespace": "unmeasured", @@ -4125,20 +4153,20 @@ "pg.functions.info.to-regoperator": "unmeasured", "pg.functions.info.to-regproc": "unmeasured", "pg.functions.info.to-regprocedure": "unmeasured", - "pg.functions.info.to-regrole": "unmeasured", + "pg.functions.info.to-regrole": "not_translatable", "pg.functions.info.to-regtype": "unmeasured", "pg.functions.info.to-regtypemod": "unmeasured", - "pg.functions.info.txid-current": "unmeasured", - "pg.functions.info.txid-current-if-assigned": "unmeasured", - "pg.functions.info.txid-current-snapshot": "unmeasured", + "pg.functions.info.txid-current": "not_translatable", + "pg.functions.info.txid-current-if-assigned": "not_translatable", + "pg.functions.info.txid-current-snapshot": "not_translatable", "pg.functions.info.txid-snapshot-xip": "unmeasured", "pg.functions.info.txid-snapshot-xmax": "unmeasured", "pg.functions.info.txid-snapshot-xmin": "unmeasured", - "pg.functions.info.txid-status": "unmeasured", + "pg.functions.info.txid-status": "not_translatable", "pg.functions.info.txid-visible-in-snapshot": "unmeasured", - "pg.functions.info.unicode-version": "unmeasured", - "pg.functions.info.user-noparens": "unmeasured", - "pg.functions.info.version": "unmeasured", + "pg.functions.info.unicode-version": "not_translatable", + "pg.functions.info.user-noparens": "not_translatable", + "pg.functions.info.version": "not_translatable", "pg.functions.json.array-to-json": "matching", "pg.functions.json.json": "matching", "pg.functions.json.json-array": "matching", @@ -4160,7 +4188,7 @@ "pg.functions.json.json-query": "unmeasured", "pg.functions.json.json-scalar": "matching", "pg.functions.json.json-serialize": "matching", - "pg.functions.json.json-strip-nulls": "refused", + "pg.functions.json.json-strip-nulls": "matching", "pg.functions.json.json-table-columns": "unmeasured", "pg.functions.json.json-to-record": "refused", "pg.functions.json.json-to-recordset": "refused", @@ -4191,48 +4219,48 @@ "pg.functions.json.jsonb-populate-record": "refused", "pg.functions.json.jsonb-populate-record-valid": "refused", "pg.functions.json.jsonb-populate-recordset": "refused", - "pg.functions.json.jsonb-pretty": "refused", + "pg.functions.json.jsonb-pretty": "matching", "pg.functions.json.jsonb-set": "refused", "pg.functions.json.jsonb-set-lax": "refused", - "pg.functions.json.jsonb-strip-nulls": "refused", + "pg.functions.json.jsonb-strip-nulls": "matching", "pg.functions.json.jsonb-to-record": "refused", "pg.functions.json.jsonb-to-recordset": "refused", "pg.functions.json.jsonb-typeof": "matching", "pg.functions.json.row-to-json": "unmeasured", "pg.functions.json.to-json": "matching", "pg.functions.json.to-jsonb": "matching", - "pg.functions.matching.substring": "refused", + "pg.functions.matching.substring": "matching", "pg.functions.math.abs": "matching", - "pg.functions.math.acos": "refused", - "pg.functions.math.acosd": "refused", - "pg.functions.math.acosh": "refused", - "pg.functions.math.asin": "refused", - "pg.functions.math.asind": "refused", - "pg.functions.math.asinh": "refused", - "pg.functions.math.atan": "refused", - "pg.functions.math.atan2": "refused", - "pg.functions.math.atan2d": "refused", - "pg.functions.math.atand": "refused", - "pg.functions.math.atanh": "refused", - "pg.functions.math.cbrt": "refused", + "pg.functions.math.acos": "matching", + "pg.functions.math.acosd": "matching", + "pg.functions.math.acosh": "matching", + "pg.functions.math.asin": "matching", + "pg.functions.math.asind": "matching", + "pg.functions.math.asinh": "matching", + "pg.functions.math.atan": "matching", + "pg.functions.math.atan2": "matching", + "pg.functions.math.atan2d": "matching", + "pg.functions.math.atand": "matching", + "pg.functions.math.atanh": "matching", + "pg.functions.math.cbrt": "matching", "pg.functions.math.ceil": "matching", "pg.functions.math.ceiling": "matching", - "pg.functions.math.cos": "refused", - "pg.functions.math.cosd": "refused", - "pg.functions.math.cosh": "refused", - "pg.functions.math.cot": "refused", - "pg.functions.math.cotd": "refused", + "pg.functions.math.cos": "matching", + "pg.functions.math.cosd": "matching", + "pg.functions.math.cosh": "matching", + "pg.functions.math.cot": "matching", + "pg.functions.math.cotd": "matching", "pg.functions.math.degrees": "matching", - "pg.functions.math.div": "refused", + "pg.functions.math.div": "matching", "pg.functions.math.erf": "refused", "pg.functions.math.erfc": "refused", "pg.functions.math.exp": "refused", "pg.functions.math.factorial": "matching", "pg.functions.math.floor": "matching", - "pg.functions.math.gamma": "refused", + "pg.functions.math.gamma": "matching", "pg.functions.math.gcd": "matching", "pg.functions.math.lcm": "matching", - "pg.functions.math.lgamma": "refused", + "pg.functions.math.lgamma": "matching", "pg.functions.math.ln": "refused", "pg.functions.math.log": "refused", "pg.functions.math.log10": "refused", @@ -4242,18 +4270,18 @@ "pg.functions.math.power": "refused", "pg.functions.math.radians": "matching", "pg.functions.math.random": "unmeasured", - "pg.functions.math.random-normal": "unmeasured", + "pg.functions.math.random-normal": "not_translatable", "pg.functions.math.round": "matching", "pg.functions.math.scale": "refused", "pg.functions.math.setseed": "unmeasured", "pg.functions.math.sign": "matching", - "pg.functions.math.sin": "refused", - "pg.functions.math.sind": "refused", - "pg.functions.math.sinh": "refused", + "pg.functions.math.sin": "matching", + "pg.functions.math.sind": "matching", + "pg.functions.math.sinh": "matching", "pg.functions.math.sqrt": "refused", - "pg.functions.math.tan": "refused", - "pg.functions.math.tand": "refused", - "pg.functions.math.tanh": "refused", + "pg.functions.math.tan": "matching", + "pg.functions.math.tand": "matching", + "pg.functions.math.tanh": "matching", "pg.functions.math.trim-scale": "refused", "pg.functions.math.trunc": "matching", "pg.functions.math.width-bucket": "refused", @@ -4271,15 +4299,15 @@ "pg.functions.net.network": "unmeasured", "pg.functions.net.set-masklen": "unmeasured", "pg.functions.net.text": "no_obligations", - "pg.functions.net.trunc": "no_obligations", + "pg.functions.net.trunc": "syntax_only", "pg.functions.range.isempty": "unmeasured", - "pg.functions.range.lower": "no_obligations", + "pg.functions.range.lower": "syntax_only", "pg.functions.range.lower-inc": "unmeasured", "pg.functions.range.lower-inf": "unmeasured", "pg.functions.range.multirange": "unmeasured", "pg.functions.range.range-merge": "unmeasured", "pg.functions.range.unnest": "no_obligations", - "pg.functions.range.upper": "no_obligations", + "pg.functions.range.upper": "syntax_only", "pg.functions.range.upper-inc": "unmeasured", "pg.functions.range.upper-inf": "unmeasured", "pg.functions.sequence.currval": "matching", @@ -4288,7 +4316,7 @@ "pg.functions.sequence.setval": "unmeasured", "pg.functions.srf.generate-series": "refused", "pg.functions.srf.generate-subscripts": "matching", - "pg.functions.statistics.pg-mcv-list-items": "unmeasured", + "pg.functions.statistics.pg-mcv-list-items": "not_translatable", "pg.functions.string.ascii": "matching", "pg.functions.string.bit-length": "matching", "pg.functions.string.btrim": "matching", @@ -4309,20 +4337,20 @@ "pg.functions.string.normalize": "matching", "pg.functions.string.octet-length": "matching", "pg.functions.string.overlay-placing-from": "matching", - "pg.functions.string.parse-ident": "refused", + "pg.functions.string.parse-ident": "matching", "pg.functions.string.pg-client-encoding": "unmeasured", "pg.functions.string.position-in": "matching", - "pg.functions.string.quote-ident": "refused", + "pg.functions.string.quote-ident": "matching", "pg.functions.string.quote-literal": "matching", "pg.functions.string.quote-nullable": "matching", "pg.functions.string.regexp-count": "matching", "pg.functions.string.regexp-instr": "matching", "pg.functions.string.regexp-like": "matching", - "pg.functions.string.regexp-match": "refused", - "pg.functions.string.regexp-matches": "refused", + "pg.functions.string.regexp-match": "matching", + "pg.functions.string.regexp-matches": "matching", "pg.functions.string.regexp-replace": "matching", - "pg.functions.string.regexp-split-to-array": "refused", - "pg.functions.string.regexp-split-to-table": "refused", + "pg.functions.string.regexp-split-to-array": "matching", + "pg.functions.string.regexp-split-to-table": "matching", "pg.functions.string.regexp-substr": "matching", "pg.functions.string.repeat": "matching", "pg.functions.string.replace": "matching", @@ -4332,14 +4360,14 @@ "pg.functions.string.rtrim": "matching", "pg.functions.string.split-part": "matching", "pg.functions.string.starts-with": "matching", - "pg.functions.string.string-to-array": "refused", - "pg.functions.string.string-to-table": "refused", + "pg.functions.string.string-to-array": "matching", + "pg.functions.string.string-to-table": "matching", "pg.functions.string.strpos": "matching", "pg.functions.string.substr": "matching", - "pg.functions.string.substring": "refused", - "pg.functions.string.substring-from": "refused", - "pg.functions.string.substring-from-for": "refused", - "pg.functions.string.substring-similar-escape": "refused", + "pg.functions.string.substring": "matching", + "pg.functions.string.substring-from": "matching", + "pg.functions.string.substring-from-for": "matching", + "pg.functions.string.substring-similar-escape": "matching", "pg.functions.string.to-ascii": "refused", "pg.functions.string.to-bin": "matching", "pg.functions.string.to-hex": "matching", @@ -4351,41 +4379,41 @@ "pg.functions.string.unistr": "matching", "pg.functions.string.upper": "matching", "pg.functions.textsearch.array-to-tsvector": "unmeasured", - "pg.functions.textsearch.get-current-ts-config": "unmeasured", - "pg.functions.textsearch.json-to-tsvector": "unmeasured", - "pg.functions.textsearch.jsonb-to-tsvector": "unmeasured", - "pg.functions.textsearch.length": "no_obligations", + "pg.functions.textsearch.get-current-ts-config": "not_translatable", + "pg.functions.textsearch.json-to-tsvector": "not_translatable", + "pg.functions.textsearch.jsonb-to-tsvector": "not_translatable", + "pg.functions.textsearch.length": "syntax_only", "pg.functions.textsearch.numnode": "unmeasured", - "pg.functions.textsearch.phraseto-tsquery": "unmeasured", - "pg.functions.textsearch.plainto-tsquery": "unmeasured", + "pg.functions.textsearch.phraseto-tsquery": "not_translatable", + "pg.functions.textsearch.plainto-tsquery": "not_translatable", "pg.functions.textsearch.querytree": "unmeasured", "pg.functions.textsearch.setweight": "unmeasured", "pg.functions.textsearch.strip": "unmeasured", - "pg.functions.textsearch.to-tsquery": "unmeasured", - "pg.functions.textsearch.to-tsvector": "unmeasured", - "pg.functions.textsearch.ts-debug": "unmeasured", + "pg.functions.textsearch.to-tsquery": "not_translatable", + "pg.functions.textsearch.to-tsvector": "not_translatable", + "pg.functions.textsearch.ts-debug": "not_translatable", "pg.functions.textsearch.ts-delete": "unmeasured", "pg.functions.textsearch.ts-filter": "unmeasured", - "pg.functions.textsearch.ts-headline": "unmeasured", - "pg.functions.textsearch.ts-lexize": "unmeasured", - "pg.functions.textsearch.ts-parse": "unmeasured", + "pg.functions.textsearch.ts-headline": "not_translatable", + "pg.functions.textsearch.ts-lexize": "not_translatable", + "pg.functions.textsearch.ts-parse": "not_translatable", "pg.functions.textsearch.ts-rank": "unmeasured", "pg.functions.textsearch.ts-rank-cd": "unmeasured", "pg.functions.textsearch.ts-rewrite": "unmeasured", - "pg.functions.textsearch.ts-stat": "unmeasured", - "pg.functions.textsearch.ts-token-type": "unmeasured", + "pg.functions.textsearch.ts-stat": "not_translatable", + "pg.functions.textsearch.ts-token-type": "not_translatable", "pg.functions.textsearch.tsquery-phrase": "unmeasured", "pg.functions.textsearch.tsvector-to-array": "unmeasured", "pg.functions.textsearch.unnest": "no_obligations", - "pg.functions.textsearch.websearch-to-tsquery": "unmeasured", - "pg.functions.trigger.suppress-redundant-updates-trigger": "unmeasured", - "pg.functions.trigger.tsvector-update-trigger": "unmeasured", - "pg.functions.trigger.tsvector-update-trigger-column": "unmeasured", - "pg.functions.uuid.gen-random-uuid": "unmeasured", - "pg.functions.uuid.uuid-extract-timestamp": "refused", + "pg.functions.textsearch.websearch-to-tsquery": "not_translatable", + "pg.functions.trigger.suppress-redundant-updates-trigger": "not_translatable", + "pg.functions.trigger.tsvector-update-trigger": "not_translatable", + "pg.functions.trigger.tsvector-update-trigger-column": "not_translatable", + "pg.functions.uuid.gen-random-uuid": "not_translatable", + "pg.functions.uuid.uuid-extract-timestamp": "matching", "pg.functions.uuid.uuid-extract-version": "matching", - "pg.functions.uuid.uuidv4": "unmeasured", - "pg.functions.uuid.uuidv7": "unmeasured", + "pg.functions.uuid.uuidv4": "not_translatable", + "pg.functions.uuid.uuidv7": "not_translatable", "pg.functions.window.cume-dist": "matching", "pg.functions.window.dense-rank": "matching", "pg.functions.window.first-value": "matching", @@ -4399,33 +4427,33 @@ "pg.functions.window.row-number": "matching", "pg.functions.xml.cursor-to-xml": "unmeasured", "pg.functions.xml.cursor-to-xmlschema": "unmeasured", - "pg.functions.xml.database-to-xml": "unmeasured", - "pg.functions.xml.database-to-xml-and-xmlschema": "unmeasured", - "pg.functions.xml.database-to-xmlschema": "unmeasured", + "pg.functions.xml.database-to-xml": "not_translatable", + "pg.functions.xml.database-to-xml-and-xmlschema": "not_translatable", + "pg.functions.xml.database-to-xmlschema": "not_translatable", "pg.functions.xml.query-to-xml": "unmeasured", "pg.functions.xml.query-to-xml-and-xmlschema": "unmeasured", "pg.functions.xml.query-to-xmlschema": "unmeasured", "pg.functions.xml.schema-to-xml": "unmeasured", - "pg.functions.xml.schema-to-xml-and-xmlschema": "unmeasured", - "pg.functions.xml.schema-to-xmlschema": "unmeasured", + "pg.functions.xml.schema-to-xml-and-xmlschema": "not_translatable", + "pg.functions.xml.schema-to-xmlschema": "not_translatable", "pg.functions.xml.table-to-xml": "unmeasured", - "pg.functions.xml.table-to-xml-and-xmlschema": "unmeasured", - "pg.functions.xml.table-to-xmlschema": "unmeasured", - "pg.functions.xml.xml-is-well-formed": "unmeasured", - "pg.functions.xml.xml-is-well-formed-content": "unmeasured", - "pg.functions.xml.xml-is-well-formed-document": "unmeasured", + "pg.functions.xml.table-to-xml-and-xmlschema": "not_translatable", + "pg.functions.xml.table-to-xmlschema": "not_translatable", + "pg.functions.xml.xml-is-well-formed": "not_translatable", + "pg.functions.xml.xml-is-well-formed-content": "not_translatable", + "pg.functions.xml.xml-is-well-formed-document": "not_translatable", "pg.functions.xml.xmlagg": "unmeasured", "pg.functions.xml.xmlcomment": "unmeasured", "pg.functions.xml.xmlconcat": "unmeasured", "pg.functions.xml.xmlelement-name": "unmeasured", - "pg.functions.xml.xmlexists-passing": "unmeasured", + "pg.functions.xml.xmlexists-passing": "not_translatable", "pg.functions.xml.xmlforest": "unmeasured", "pg.functions.xml.xmlpi-name": "unmeasured", - "pg.functions.xml.xmlroot-version": "unmeasured", - "pg.functions.xml.xmltable-passing-columns": "unmeasured", + "pg.functions.xml.xmlroot-version": "not_translatable", + "pg.functions.xml.xmltable-passing-columns": "not_translatable", "pg.functions.xml.xmltext": "unmeasured", - "pg.functions.xml.xpath": "unmeasured", - "pg.functions.xml.xpath-exists": "unmeasured", + "pg.functions.xml.xpath": "not_translatable", + "pg.functions.xml.xpath-exists": "not_translatable", "pg.query.queries-table-expressions.join-on": "unmeasured", "pg.query.queries-table-expressions.join-using": "unmeasured", "pg.query.queries-table-expressions.natural-join": "unmeasured", @@ -4433,99 +4461,99 @@ "pg.query.select.select": "refused", "pg.query.select.table": "unmeasured", "pg.query.values": "unmeasured", - "pg.security_admin.alter-default-privileges": "unmeasured", - "pg.security_admin.alter-group.add-user": "unmeasured", - "pg.security_admin.alter-group.drop-user": "unmeasured", - "pg.security_admin.alter-group.rename-to": "unmeasured", + "pg.security_admin.alter-default-privileges": "not_translatable", + "pg.security_admin.alter-group.add-user": "not_translatable", + "pg.security_admin.alter-group.drop-user": "not_translatable", + "pg.security_admin.alter-group.rename-to": "not_translatable", "pg.security_admin.alter-policy.on-table-name": "unmeasured", "pg.security_admin.alter-policy.rename-to": "unmeasured", - "pg.security_admin.alter-role.rename-to": "unmeasured", - "pg.security_admin.alter-role.reset": "unmeasured", - "pg.security_admin.alter-role.reset-all": "unmeasured", - "pg.security_admin.alter-role.role-specification-option": "unmeasured", - "pg.security_admin.alter-role.set": "unmeasured", - "pg.security_admin.alter-role.set-from-current": "unmeasured", - "pg.security_admin.alter-system.reset": "unmeasured", - "pg.security_admin.alter-system.reset-all": "unmeasured", - "pg.security_admin.alter-system.set": "unmeasured", - "pg.security_admin.alter-user-mapping": "unmeasured", - "pg.security_admin.alter-user.rename-to": "unmeasured", - "pg.security_admin.alter-user.reset": "unmeasured", - "pg.security_admin.alter-user.reset-all": "unmeasured", - "pg.security_admin.alter-user.role-specification-option": "unmeasured", - "pg.security_admin.alter-user.set": "unmeasured", - "pg.security_admin.alter-user.set-from-current": "unmeasured", - "pg.security_admin.create-group": "unmeasured", + "pg.security_admin.alter-role.rename-to": "not_translatable", + "pg.security_admin.alter-role.reset": "not_translatable", + "pg.security_admin.alter-role.reset-all": "not_translatable", + "pg.security_admin.alter-role.role-specification-option": "not_translatable", + "pg.security_admin.alter-role.set": "not_translatable", + "pg.security_admin.alter-role.set-from-current": "not_translatable", + "pg.security_admin.alter-system.reset": "not_translatable", + "pg.security_admin.alter-system.reset-all": "not_translatable", + "pg.security_admin.alter-system.set": "not_translatable", + "pg.security_admin.alter-user-mapping": "not_translatable", + "pg.security_admin.alter-user.rename-to": "not_translatable", + "pg.security_admin.alter-user.reset": "not_translatable", + "pg.security_admin.alter-user.reset-all": "not_translatable", + "pg.security_admin.alter-user.role-specification-option": "not_translatable", + "pg.security_admin.alter-user.set": "not_translatable", + "pg.security_admin.alter-user.set-from-current": "not_translatable", + "pg.security_admin.create-group": "not_translatable", "pg.security_admin.create-policy": "unmeasured", - "pg.security_admin.create-role": "unmeasured", - "pg.security_admin.create-role.in-group": "unmeasured", - "pg.security_admin.create-role.with-user": "unmeasured", - "pg.security_admin.create-user": "unmeasured", - "pg.security_admin.create-user-mapping": "unmeasured", - "pg.security_admin.drop-group": "unmeasured", - "pg.security_admin.drop-owned": "unmeasured", + "pg.security_admin.create-role": "not_translatable", + "pg.security_admin.create-role.in-group": "not_translatable", + "pg.security_admin.create-role.with-user": "not_translatable", + "pg.security_admin.create-user": "not_translatable", + "pg.security_admin.create-user-mapping": "not_translatable", + "pg.security_admin.drop-group": "not_translatable", + "pg.security_admin.drop-owned": "not_translatable", "pg.security_admin.drop-policy": "unmeasured", - "pg.security_admin.drop-role": "unmeasured", - "pg.security_admin.drop-user": "unmeasured", - "pg.security_admin.drop-user-mapping": "unmeasured", - "pg.security_admin.grant.on-database-to": "unmeasured", - "pg.security_admin.grant.on-domain-to": "unmeasured", - "pg.security_admin.grant.on-foreign-data-wrapper": "unmeasured", - "pg.security_admin.grant.on-foreign-server-to": "unmeasured", - "pg.security_admin.grant.on-language-to": "unmeasured", - "pg.security_admin.grant.on-large-object-to": "unmeasured", - "pg.security_admin.grant.on-parameter-to": "unmeasured", - "pg.security_admin.grant.on-schema-to": "unmeasured", - "pg.security_admin.grant.on-tablespace-to": "unmeasured", - "pg.security_admin.grant.on-to-execute-function-procedure-routine-functions-procedures-routines-in-schema": "unmeasured", - "pg.security_admin.grant.on-to-select-insert-update-delete-truncate-references-trigger-maintain-table-tables-in-schema": "unmeasured", - "pg.security_admin.grant.on-to-select-insert-update-references-table": "unmeasured", - "pg.security_admin.grant.on-to-usage-select-update-sequence-sequences-in-schema": "unmeasured", - "pg.security_admin.grant.on-type-to": "unmeasured", - "pg.security_admin.grant.to": "unmeasured", - "pg.security_admin.reassign-owned": "unmeasured", - "pg.security_admin.revoke.from": "unmeasured", - "pg.security_admin.revoke.on-database-from": "unmeasured", - "pg.security_admin.revoke.on-domain-from": "unmeasured", - "pg.security_admin.revoke.on-foreign-data-wrapper": "unmeasured", - "pg.security_admin.revoke.on-foreign-server-from": "unmeasured", - "pg.security_admin.revoke.on-from-execute-function-procedure-routine-functions-procedures-routines-in-schema": "unmeasured", - "pg.security_admin.revoke.on-from-select-insert-update-delete-truncate-references-trigger-maintain-table-tables-in-schema": "unmeasured", - "pg.security_admin.revoke.on-from-select-insert-update-references-table": "unmeasured", - "pg.security_admin.revoke.on-from-usage-select-update-sequence-sequences-in-schema": "unmeasured", - "pg.security_admin.revoke.on-language-from": "unmeasured", - "pg.security_admin.revoke.on-large-object-from": "unmeasured", - "pg.security_admin.revoke.on-parameter-from": "unmeasured", - "pg.security_admin.revoke.on-schema-from": "unmeasured", - "pg.security_admin.revoke.on-tablespace-from": "unmeasured", - "pg.security_admin.revoke.on-type-from": "unmeasured", - "pg.security_admin.security-label": "unmeasured", + "pg.security_admin.drop-role": "not_translatable", + "pg.security_admin.drop-user": "not_translatable", + "pg.security_admin.drop-user-mapping": "not_translatable", + "pg.security_admin.grant.on-database-to": "not_translatable", + "pg.security_admin.grant.on-domain-to": "not_translatable", + "pg.security_admin.grant.on-foreign-data-wrapper": "not_translatable", + "pg.security_admin.grant.on-foreign-server-to": "not_translatable", + "pg.security_admin.grant.on-language-to": "not_translatable", + "pg.security_admin.grant.on-large-object-to": "not_translatable", + "pg.security_admin.grant.on-parameter-to": "not_translatable", + "pg.security_admin.grant.on-schema-to": "not_translatable", + "pg.security_admin.grant.on-tablespace-to": "not_translatable", + "pg.security_admin.grant.on-to-execute-function-procedure-routine-functions-procedures-routines-in-schema": "not_translatable", + "pg.security_admin.grant.on-to-select-insert-update-delete-truncate-references-trigger-maintain-table-tables-in-schema": "not_translatable", + "pg.security_admin.grant.on-to-select-insert-update-references-table": "not_translatable", + "pg.security_admin.grant.on-to-usage-select-update-sequence-sequences-in-schema": "not_translatable", + "pg.security_admin.grant.on-type-to": "not_translatable", + "pg.security_admin.grant.to": "not_translatable", + "pg.security_admin.reassign-owned": "not_translatable", + "pg.security_admin.revoke.from": "not_translatable", + "pg.security_admin.revoke.on-database-from": "not_translatable", + "pg.security_admin.revoke.on-domain-from": "not_translatable", + "pg.security_admin.revoke.on-foreign-data-wrapper": "not_translatable", + "pg.security_admin.revoke.on-foreign-server-from": "not_translatable", + "pg.security_admin.revoke.on-from-execute-function-procedure-routine-functions-procedures-routines-in-schema": "not_translatable", + "pg.security_admin.revoke.on-from-select-insert-update-delete-truncate-references-trigger-maintain-table-tables-in-schema": "not_translatable", + "pg.security_admin.revoke.on-from-select-insert-update-references-table": "not_translatable", + "pg.security_admin.revoke.on-from-usage-select-update-sequence-sequences-in-schema": "not_translatable", + "pg.security_admin.revoke.on-language-from": "not_translatable", + "pg.security_admin.revoke.on-large-object-from": "not_translatable", + "pg.security_admin.revoke.on-parameter-from": "not_translatable", + "pg.security_admin.revoke.on-schema-from": "not_translatable", + "pg.security_admin.revoke.on-tablespace-from": "not_translatable", + "pg.security_admin.revoke.on-type-from": "not_translatable", + "pg.security_admin.security-label": "not_translatable", "pg.transaction_session.abort": "matching", "pg.transaction_session.begin": "matching", "pg.transaction_session.commit": "matching", - "pg.transaction_session.commit-prepared": "unmeasured", - "pg.transaction_session.datatype-xml.set-xml-option": "unmeasured", + "pg.transaction_session.commit-prepared": "not_translatable", + "pg.transaction_session.datatype-xml.set-xml-option": "not_translatable", "pg.transaction_session.discard": "unmeasured", "pg.transaction_session.end": "matching", - "pg.transaction_session.lock": "unmeasured", - "pg.transaction_session.prepare-transaction": "unmeasured", + "pg.transaction_session.lock": "not_translatable", + "pg.transaction_session.prepare-transaction": "not_translatable", "pg.transaction_session.release-savepoint": "unmeasured", "pg.transaction_session.reset.all": "unmeasured", "pg.transaction_session.reset.configuration-parameter": "matching", "pg.transaction_session.rollback": "matching", - "pg.transaction_session.rollback-prepared": "unmeasured", + "pg.transaction_session.rollback-prepared": "not_translatable", "pg.transaction_session.rollback-to-savepoint": "unmeasured", "pg.transaction_session.savepoint": "unmeasured", - "pg.transaction_session.set-constraints": "unmeasured", - "pg.transaction_session.set-role.reset-role": "unmeasured", - "pg.transaction_session.set-role.role-name": "unmeasured", - "pg.transaction_session.set-role.set-role-none": "unmeasured", - "pg.transaction_session.set-session-authorization.reset-session-authorization": "unmeasured", - "pg.transaction_session.set-session-authorization.set-session-authorization-default": "unmeasured", - "pg.transaction_session.set-session-authorization.user-name": "unmeasured", + "pg.transaction_session.set-constraints": "not_translatable", + "pg.transaction_session.set-role.reset-role": "not_translatable", + "pg.transaction_session.set-role.role-name": "not_translatable", + "pg.transaction_session.set-role.set-role-none": "not_translatable", + "pg.transaction_session.set-session-authorization.reset-session-authorization": "not_translatable", + "pg.transaction_session.set-session-authorization.set-session-authorization-default": "not_translatable", + "pg.transaction_session.set-session-authorization.user-name": "not_translatable", "pg.transaction_session.set-transaction.session-characteristics-as-transaction": "unmeasured", "pg.transaction_session.set-transaction.transaction": "unmeasured", - "pg.transaction_session.set-transaction.transaction-snapshot": "unmeasured", + "pg.transaction_session.set-transaction.transaction-snapshot": "not_translatable", "pg.transaction_session.set.configuration-parameter": "matching", "pg.transaction_session.set.names": "unmeasured", "pg.transaction_session.set.schema": "unmeasured", @@ -4533,32 +4561,32 @@ "pg.transaction_session.show.all": "unmeasured", "pg.transaction_session.show.name": "unmeasured", "pg.transaction_session.start-transaction": "matching", - "pg.utility.analyze": "unmeasured", - "pg.utility.analyze.pre-11": "unmeasured", + "pg.utility.analyze": "not_translatable", + "pg.utility.analyze.pre-11": "not_translatable", "pg.utility.call": "unmeasured", - "pg.utility.checkpoint": "unmeasured", + "pg.utility.checkpoint": "not_translatable", "pg.utility.close": "unmeasured", - "pg.utility.cluster": "unmeasured", - "pg.utility.cluster.pre-17": "unmeasured", - "pg.utility.cluster.pre-8-3": "unmeasured", + "pg.utility.cluster": "not_translatable", + "pg.utility.cluster.pre-17": "not_translatable", + "pg.utility.cluster.pre-8-3": "not_translatable", "pg.utility.deallocate": "matching", "pg.utility.declare": "unmeasured", - "pg.utility.do": "unmeasured", + "pg.utility.do": "not_translatable", "pg.utility.execute": "matching", - "pg.utility.explain": "unmeasured", - "pg.utility.explain.pre-9-0": "unmeasured", + "pg.utility.explain": "not_translatable", + "pg.utility.explain.pre-9-0": "not_translatable", "pg.utility.fetch": "unmeasured", - "pg.utility.listen": "unmeasured", - "pg.utility.load": "unmeasured", + "pg.utility.listen": "not_translatable", + "pg.utility.load": "not_translatable", "pg.utility.move": "unmeasured", - "pg.utility.notify": "unmeasured", + "pg.utility.notify": "not_translatable", "pg.utility.prepare": "matching", "pg.utility.refresh-materialized-view": "unmeasured", - "pg.utility.reindex.database-system": "unmeasured", - "pg.utility.reindex.index-table-schema": "unmeasured", - "pg.utility.unlisten": "unmeasured", - "pg.utility.vacuum": "unmeasured", - "pg.utility.vacuum.pre-9-0": "unmeasured" + "pg.utility.reindex.database-system": "not_translatable", + "pg.utility.reindex.index-table-schema": "not_translatable", + "pg.utility.unlisten": "not_translatable", + "pg.utility.vacuum": "not_translatable", + "pg.utility.vacuum.pre-9-0": "not_translatable" }, "obligations": { "pg.ddl.alter-index.rename-to.t001": "unmet", @@ -4930,7 +4958,7 @@ "pg.expressions.datetime.op-minus.t001": "met", "pg.expressions.datetime.op-minus.t002": "met", "pg.expressions.datetime.op-minus.t003": "met", - "pg.expressions.datetime.op-minus.t004": "unmet", + "pg.expressions.datetime.op-minus.t004": "met", "pg.expressions.datetime.op-plus.t001": "met", "pg.expressions.datetime.op-plus.t002": "met", "pg.expressions.datetime.op-plus.t003": "met", @@ -5094,9 +5122,9 @@ "pg.expressions.math.op-at.t004": "met", "pg.expressions.math.op-at.t005": "met", "pg.expressions.math.op-at.t006": "met", - "pg.expressions.math.op-bar-bar-slash.t001": "unmet", - "pg.expressions.math.op-bar-bar-slash.t002": "unmet", - "pg.expressions.math.op-bar-bar-slash.t003": "unmet", + "pg.expressions.math.op-bar-bar-slash.t001": "met", + "pg.expressions.math.op-bar-bar-slash.t002": "met", + "pg.expressions.math.op-bar-bar-slash.t003": "met", "pg.expressions.math.op-bar-slash.t001": "met", "pg.expressions.math.op-bar-slash.t002": "met", "pg.expressions.math.op-bar-slash.t003": "met", @@ -5298,9 +5326,14 @@ "pg.expressions.subquery.some-row.t001": "met", "pg.expressions.subquery.some-row.t002": "met", "pg.expressions.subquery.some.t001": "met", - "pg.functions.aggregate.any-value.t001": "unmet", - "pg.functions.aggregate.any-value.t002": "unmet", - "pg.functions.aggregate.any-value.t003": "unmet", + "pg.functions.aggregate.any-value.t001": "met", + "pg.functions.aggregate.any-value.t002": "met", + "pg.functions.aggregate.any-value.t003": "uncredited", + "pg.functions.aggregate.any-value.t004": "met", + "pg.functions.aggregate.any-value.t005": "met", + "pg.functions.aggregate.array-agg-order-by.t001": "met", + "pg.functions.aggregate.array-agg-order-by.t002": "met", + "pg.functions.aggregate.array-agg-order-by.t003": "met", "pg.functions.aggregate.avg.t001": "unmet", "pg.functions.aggregate.avg.t002": "unmet", "pg.functions.aggregate.avg.t003": "met", @@ -5355,38 +5388,59 @@ "pg.functions.aggregate.every.t001": "met", "pg.functions.aggregate.every.t002": "met", "pg.functions.aggregate.every.t003": "met", - "pg.functions.aggregate.json-agg-strict.t001": "unmet", - "pg.functions.aggregate.json-agg-strict.t002": "unmet", - "pg.functions.aggregate.json-agg-strict.t003": "unmet", + "pg.functions.aggregate.json-agg-order-by.t001": "met", + "pg.functions.aggregate.json-agg-order-by.t002": "met", + "pg.functions.aggregate.json-agg-order-by.t003": "met", + "pg.functions.aggregate.json-agg-strict.t001": "met", + "pg.functions.aggregate.json-agg-strict.t002": "met", + "pg.functions.aggregate.json-agg-strict.t003": "met", + "pg.functions.aggregate.json-agg-strict.t004": "uncredited", + "pg.functions.aggregate.json-agg-strict.t005": "met", + "pg.functions.aggregate.json-agg-strict.t006": "met", "pg.functions.aggregate.json-arrayagg.t001": "met", - "pg.functions.aggregate.json-object-agg-strict.t001": "unmet", - "pg.functions.aggregate.json-object-agg-strict.t002": "unmet", - "pg.functions.aggregate.json-object-agg-strict.t003": "unmet", - "pg.functions.aggregate.json-object-agg-strict.t004": "unmet", - "pg.functions.aggregate.json-object-agg-unique-strict.t001": "unmet", - "pg.functions.aggregate.json-object-agg-unique-strict.t002": "unmet", - "pg.functions.aggregate.json-object-agg-unique-strict.t003": "unmet", - "pg.functions.aggregate.json-object-agg-unique-strict.t004": "unmet", - "pg.functions.aggregate.json-object-agg-unique.t001": "unmet", - "pg.functions.aggregate.json-object-agg-unique.t002": "unmet", - "pg.functions.aggregate.json-object-agg-unique.t003": "unmet", - "pg.functions.aggregate.json-object-agg-unique.t004": "unmet", + "pg.functions.aggregate.json-object-agg-order-by.t001": "met", + "pg.functions.aggregate.json-object-agg-order-by.t002": "met", + "pg.functions.aggregate.json-object-agg-order-by.t003": "met", + "pg.functions.aggregate.json-object-agg-strict.t001": "met", + "pg.functions.aggregate.json-object-agg-strict.t002": "uncredited", + "pg.functions.aggregate.json-object-agg-strict.t003": "met", + "pg.functions.aggregate.json-object-agg-strict.t004": "met", + "pg.functions.aggregate.json-object-agg-strict.t005": "met", + "pg.functions.aggregate.json-object-agg-unique-strict.t001": "met", + "pg.functions.aggregate.json-object-agg-unique-strict.t002": "uncredited", + "pg.functions.aggregate.json-object-agg-unique-strict.t003": "met", + "pg.functions.aggregate.json-object-agg-unique-strict.t004": "met", + "pg.functions.aggregate.json-object-agg-unique-strict.t005": "met", + "pg.functions.aggregate.json-object-agg-unique.t001": "met", + "pg.functions.aggregate.json-object-agg-unique.t002": "met", + "pg.functions.aggregate.json-object-agg-unique.t003": "uncredited", + "pg.functions.aggregate.json-object-agg-unique.t004": "met", + "pg.functions.aggregate.json-object-agg-unique.t005": "met", + "pg.functions.aggregate.json-object-agg-unique.t006": "met", "pg.functions.aggregate.json-objectagg.t001": "met", - "pg.functions.aggregate.jsonb-agg-strict.t001": "unmet", - "pg.functions.aggregate.jsonb-agg-strict.t002": "unmet", - "pg.functions.aggregate.jsonb-agg-strict.t003": "unmet", - "pg.functions.aggregate.jsonb-object-agg-strict.t001": "unmet", - "pg.functions.aggregate.jsonb-object-agg-strict.t002": "unmet", - "pg.functions.aggregate.jsonb-object-agg-strict.t003": "unmet", - "pg.functions.aggregate.jsonb-object-agg-strict.t004": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique-strict.t001": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique-strict.t002": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique-strict.t003": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique-strict.t004": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique.t001": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique.t002": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique.t003": "unmet", - "pg.functions.aggregate.jsonb-object-agg-unique.t004": "unmet", + "pg.functions.aggregate.jsonb-agg-order-by.t001": "met", + "pg.functions.aggregate.jsonb-agg-order-by.t002": "met", + "pg.functions.aggregate.jsonb-agg-order-by.t003": "met", + "pg.functions.aggregate.jsonb-agg-strict.t001": "met", + "pg.functions.aggregate.jsonb-agg-strict.t002": "met", + "pg.functions.aggregate.jsonb-agg-strict.t003": "met", + "pg.functions.aggregate.jsonb-agg-strict.t004": "uncredited", + "pg.functions.aggregate.jsonb-agg-strict.t005": "met", + "pg.functions.aggregate.jsonb-agg-strict.t006": "met", + "pg.functions.aggregate.jsonb-object-agg-order-by.t001": "met", + "pg.functions.aggregate.jsonb-object-agg-order-by.t002": "met", + "pg.functions.aggregate.jsonb-object-agg-strict.t001": "met", + "pg.functions.aggregate.jsonb-object-agg-strict.t002": "met", + "pg.functions.aggregate.jsonb-object-agg-strict.t003": "met", + "pg.functions.aggregate.jsonb-object-agg-strict.t004": "met", + "pg.functions.aggregate.jsonb-object-agg-unique-strict.t001": "met", + "pg.functions.aggregate.jsonb-object-agg-unique-strict.t002": "met", + "pg.functions.aggregate.jsonb-object-agg-unique-strict.t003": "met", + "pg.functions.aggregate.jsonb-object-agg-unique-strict.t004": "met", + "pg.functions.aggregate.jsonb-object-agg-unique.t001": "met", + "pg.functions.aggregate.jsonb-object-agg-unique.t002": "met", + "pg.functions.aggregate.jsonb-object-agg-unique.t003": "met", + "pg.functions.aggregate.jsonb-object-agg-unique.t004": "met", "pg.functions.aggregate.max.t001": "met", "pg.functions.aggregate.max.t002": "met", "pg.functions.aggregate.max.t003": "met", @@ -5468,10 +5522,12 @@ "pg.functions.aggregate.string-agg-order-by.t001": "met", "pg.functions.aggregate.string-agg-order-by.t002": "met", "pg.functions.aggregate.string-agg-order-by.t003": "met", - "pg.functions.aggregate.string-agg.t001": "unmet", - "pg.functions.aggregate.string-agg.t002": "unmet", - "pg.functions.aggregate.string-agg.t003": "unmet", - "pg.functions.aggregate.string-agg.t004": "unmet", + "pg.functions.aggregate.string-agg.t001": "met", + "pg.functions.aggregate.string-agg.t002": "met", + "pg.functions.aggregate.string-agg.t003": "uncredited", + "pg.functions.aggregate.string-agg.t004": "met", + "pg.functions.aggregate.string-agg.t005": "met", + "pg.functions.aggregate.string-agg.t006": "met", "pg.functions.aggregate.sum.t001": "met", "pg.functions.aggregate.sum.t002": "met", "pg.functions.aggregate.sum.t003": "met", @@ -5577,19 +5633,19 @@ "pg.functions.binarystring.btrim.t002": "met", "pg.functions.binarystring.btrim.t003": "met", "pg.functions.binarystring.btrim.t004": "met", - "pg.functions.binarystring.convert-from.t001": "unmet", - "pg.functions.binarystring.convert-from.t002": "unmet", - "pg.functions.binarystring.convert-from.t003": "unmet", - "pg.functions.binarystring.convert-from.t004": "unmet", - "pg.functions.binarystring.convert-to.t001": "unmet", - "pg.functions.binarystring.convert-to.t002": "unmet", - "pg.functions.binarystring.convert-to.t003": "unmet", - "pg.functions.binarystring.convert-to.t004": "unmet", - "pg.functions.binarystring.convert.t001": "unmet", - "pg.functions.binarystring.convert.t002": "unmet", - "pg.functions.binarystring.convert.t003": "unmet", - "pg.functions.binarystring.convert.t004": "unmet", - "pg.functions.binarystring.convert.t005": "unmet", + "pg.functions.binarystring.convert-from.t001": "met", + "pg.functions.binarystring.convert-from.t002": "met", + "pg.functions.binarystring.convert-from.t003": "met", + "pg.functions.binarystring.convert-from.t004": "met", + "pg.functions.binarystring.convert-to.t001": "met", + "pg.functions.binarystring.convert-to.t002": "met", + "pg.functions.binarystring.convert-to.t003": "met", + "pg.functions.binarystring.convert-to.t004": "met", + "pg.functions.binarystring.convert.t001": "met", + "pg.functions.binarystring.convert.t002": "met", + "pg.functions.binarystring.convert.t003": "met", + "pg.functions.binarystring.convert.t004": "met", + "pg.functions.binarystring.convert.t005": "met", "pg.functions.binarystring.crc32.t001": "unmet", "pg.functions.binarystring.crc32.t002": "unmet", "pg.functions.binarystring.crc32.t003": "unmet", @@ -5708,17 +5764,17 @@ "pg.functions.bitstring.set-bit.t003": "met", "pg.functions.bitstring.set-bit.t004": "met", "pg.functions.bitstring.set-bit.t005": "met", - "pg.functions.bitstring.substring.t001": "unmet", - "pg.functions.bitstring.substring.t002": "unmet", + "pg.functions.bitstring.substring.t001": "met", + "pg.functions.bitstring.substring.t002": "met", "pg.functions.bitstring.substring.t003": "met", - "pg.functions.comparison.num-nonnulls.t001": "unmet", - "pg.functions.comparison.num-nonnulls.t002": "unmet", - "pg.functions.comparison.num-nonnulls.t003": "unmet", - "pg.functions.comparison.num-nonnulls.t004": "unmet", - "pg.functions.comparison.num-nulls.t001": "unmet", - "pg.functions.comparison.num-nulls.t002": "unmet", - "pg.functions.comparison.num-nulls.t003": "unmet", - "pg.functions.comparison.num-nulls.t004": "unmet", + "pg.functions.comparison.num-nonnulls.t001": "met", + "pg.functions.comparison.num-nonnulls.t002": "met", + "pg.functions.comparison.num-nonnulls.t003": "met", + "pg.functions.comparison.num-nonnulls.t004": "met", + "pg.functions.comparison.num-nulls.t001": "met", + "pg.functions.comparison.num-nulls.t002": "met", + "pg.functions.comparison.num-nulls.t003": "met", + "pg.functions.comparison.num-nulls.t004": "met", "pg.functions.conditional.coalesce.t001": "met", "pg.functions.conditional.coalesce.t002": "met", "pg.functions.conditional.coalesce.t003": "met", @@ -5771,11 +5827,11 @@ "pg.functions.datetime.date-trunc.t006": "met", "pg.functions.datetime.date-trunc.t007": "met", "pg.functions.datetime.date-trunc.t008": "met", - "pg.functions.datetime.extract.t001": "unmet", + "pg.functions.datetime.extract.t001": "met", "pg.functions.datetime.extract.t002": "met", - "pg.functions.datetime.extract.t003": "unmet", - "pg.functions.datetime.extract.t004": "unmet", - "pg.functions.datetime.extract.t005": "unmet", + "pg.functions.datetime.extract.t003": "met", + "pg.functions.datetime.extract.t004": "met", + "pg.functions.datetime.extract.t005": "met", "pg.functions.datetime.isfinite.t001": "met", "pg.functions.datetime.isfinite.t002": "met", "pg.functions.datetime.isfinite.t003": "met", @@ -5935,9 +5991,9 @@ "pg.functions.json.json-serialize.t003": "met", "pg.functions.json.json-serialize.t004": "met", "pg.functions.json.json-serialize.t005": "met", - "pg.functions.json.json-strip-nulls.t001": "unmet", - "pg.functions.json.json-strip-nulls.t002": "unmet", - "pg.functions.json.json-strip-nulls.t003": "unmet", + "pg.functions.json.json-strip-nulls.t001": "met", + "pg.functions.json.json-strip-nulls.t002": "met", + "pg.functions.json.json-strip-nulls.t003": "met", "pg.functions.json.json-to-record.t001": "met", "pg.functions.json.json-to-record.t002": "unmet", "pg.functions.json.json-to-record.t003": "unmet", @@ -6058,9 +6114,9 @@ "pg.functions.json.jsonb-populate-recordset.t002": "unmet", "pg.functions.json.jsonb-populate-recordset.t003": "unmet", "pg.functions.json.jsonb-populate-recordset.t004": "unmet", - "pg.functions.json.jsonb-pretty.t001": "unmet", - "pg.functions.json.jsonb-pretty.t002": "unmet", - "pg.functions.json.jsonb-pretty.t003": "unmet", + "pg.functions.json.jsonb-pretty.t001": "met", + "pg.functions.json.jsonb-pretty.t002": "met", + "pg.functions.json.jsonb-pretty.t003": "met", "pg.functions.json.jsonb-set-lax.t001": "unmet", "pg.functions.json.jsonb-set-lax.t002": "unmet", "pg.functions.json.jsonb-set-lax.t003": "unmet", @@ -6071,9 +6127,9 @@ "pg.functions.json.jsonb-set.t003": "unmet", "pg.functions.json.jsonb-set.t004": "unmet", "pg.functions.json.jsonb-set.t005": "unmet", - "pg.functions.json.jsonb-strip-nulls.t001": "unmet", - "pg.functions.json.jsonb-strip-nulls.t002": "unmet", - "pg.functions.json.jsonb-strip-nulls.t003": "unmet", + "pg.functions.json.jsonb-strip-nulls.t001": "met", + "pg.functions.json.jsonb-strip-nulls.t002": "met", + "pg.functions.json.jsonb-strip-nulls.t003": "met", "pg.functions.json.jsonb-to-record.t001": "met", "pg.functions.json.jsonb-to-record.t002": "unmet", "pg.functions.json.jsonb-to-record.t003": "unmet", @@ -6092,55 +6148,55 @@ "pg.functions.json.to-jsonb.t002": "met", "pg.functions.json.to-jsonb.t003": "met", "pg.functions.json.to-jsonb.t004": "met", - "pg.functions.matching.substring.t001": "unmet", - "pg.functions.matching.substring.t002": "unmet", - "pg.functions.matching.substring.t003": "unmet", - "pg.functions.matching.substring.t004": "unmet", - "pg.functions.matching.substring.t005": "unmet", + "pg.functions.matching.substring.t001": "met", + "pg.functions.matching.substring.t002": "met", + "pg.functions.matching.substring.t003": "met", + "pg.functions.matching.substring.t004": "met", + "pg.functions.matching.substring.t005": "met", "pg.functions.math.abs.t001": "met", "pg.functions.math.abs.t002": "met", "pg.functions.math.abs.t003": "met", "pg.functions.math.abs.t004": "met", "pg.functions.math.abs.t005": "met", "pg.functions.math.abs.t006": "met", - "pg.functions.math.acos.t001": "unmet", - "pg.functions.math.acos.t002": "unmet", - "pg.functions.math.acos.t003": "unmet", - "pg.functions.math.acosd.t001": "unmet", - "pg.functions.math.acosd.t002": "unmet", - "pg.functions.math.acosd.t003": "unmet", - "pg.functions.math.acosh.t001": "unmet", - "pg.functions.math.acosh.t002": "unmet", - "pg.functions.math.acosh.t003": "unmet", - "pg.functions.math.asin.t001": "unmet", - "pg.functions.math.asin.t002": "unmet", - "pg.functions.math.asin.t003": "unmet", - "pg.functions.math.asind.t001": "unmet", - "pg.functions.math.asind.t002": "unmet", - "pg.functions.math.asind.t003": "unmet", - "pg.functions.math.asinh.t001": "unmet", - "pg.functions.math.asinh.t002": "unmet", - "pg.functions.math.asinh.t003": "unmet", - "pg.functions.math.atan.t001": "unmet", - "pg.functions.math.atan.t002": "unmet", - "pg.functions.math.atan.t003": "unmet", - "pg.functions.math.atan2.t001": "unmet", - "pg.functions.math.atan2.t002": "unmet", - "pg.functions.math.atan2.t003": "unmet", - "pg.functions.math.atan2.t004": "unmet", - "pg.functions.math.atan2d.t001": "unmet", - "pg.functions.math.atan2d.t002": "unmet", - "pg.functions.math.atan2d.t003": "unmet", - "pg.functions.math.atan2d.t004": "unmet", - "pg.functions.math.atand.t001": "unmet", - "pg.functions.math.atand.t002": "unmet", - "pg.functions.math.atand.t003": "unmet", - "pg.functions.math.atanh.t001": "unmet", - "pg.functions.math.atanh.t002": "unmet", - "pg.functions.math.atanh.t003": "unmet", - "pg.functions.math.cbrt.t001": "unmet", - "pg.functions.math.cbrt.t002": "unmet", - "pg.functions.math.cbrt.t003": "unmet", + "pg.functions.math.acos.t001": "met", + "pg.functions.math.acos.t002": "met", + "pg.functions.math.acos.t003": "met", + "pg.functions.math.acosd.t001": "met", + "pg.functions.math.acosd.t002": "met", + "pg.functions.math.acosd.t003": "met", + "pg.functions.math.acosh.t001": "met", + "pg.functions.math.acosh.t002": "met", + "pg.functions.math.acosh.t003": "met", + "pg.functions.math.asin.t001": "met", + "pg.functions.math.asin.t002": "met", + "pg.functions.math.asin.t003": "met", + "pg.functions.math.asind.t001": "met", + "pg.functions.math.asind.t002": "met", + "pg.functions.math.asind.t003": "met", + "pg.functions.math.asinh.t001": "met", + "pg.functions.math.asinh.t002": "met", + "pg.functions.math.asinh.t003": "met", + "pg.functions.math.atan.t001": "met", + "pg.functions.math.atan.t002": "met", + "pg.functions.math.atan.t003": "met", + "pg.functions.math.atan2.t001": "met", + "pg.functions.math.atan2.t002": "met", + "pg.functions.math.atan2.t003": "met", + "pg.functions.math.atan2.t004": "met", + "pg.functions.math.atan2d.t001": "met", + "pg.functions.math.atan2d.t002": "met", + "pg.functions.math.atan2d.t003": "met", + "pg.functions.math.atan2d.t004": "met", + "pg.functions.math.atand.t001": "met", + "pg.functions.math.atand.t002": "met", + "pg.functions.math.atand.t003": "met", + "pg.functions.math.atanh.t001": "met", + "pg.functions.math.atanh.t002": "met", + "pg.functions.math.atanh.t003": "met", + "pg.functions.math.cbrt.t001": "met", + "pg.functions.math.cbrt.t002": "met", + "pg.functions.math.cbrt.t003": "met", "pg.functions.math.ceil.t001": "met", "pg.functions.math.ceil.t002": "met", "pg.functions.math.ceil.t003": "met", @@ -6149,28 +6205,28 @@ "pg.functions.math.ceiling.t002": "met", "pg.functions.math.ceiling.t003": "met", "pg.functions.math.ceiling.t004": "met", - "pg.functions.math.cos.t001": "unmet", - "pg.functions.math.cos.t002": "unmet", - "pg.functions.math.cos.t003": "unmet", - "pg.functions.math.cosd.t001": "unmet", - "pg.functions.math.cosd.t002": "unmet", - "pg.functions.math.cosd.t003": "unmet", - "pg.functions.math.cosh.t001": "unmet", - "pg.functions.math.cosh.t002": "unmet", - "pg.functions.math.cosh.t003": "unmet", - "pg.functions.math.cot.t001": "unmet", - "pg.functions.math.cot.t002": "unmet", - "pg.functions.math.cot.t003": "unmet", - "pg.functions.math.cotd.t001": "unmet", - "pg.functions.math.cotd.t002": "unmet", - "pg.functions.math.cotd.t003": "unmet", + "pg.functions.math.cos.t001": "met", + "pg.functions.math.cos.t002": "met", + "pg.functions.math.cos.t003": "met", + "pg.functions.math.cosd.t001": "met", + "pg.functions.math.cosd.t002": "met", + "pg.functions.math.cosd.t003": "met", + "pg.functions.math.cosh.t001": "met", + "pg.functions.math.cosh.t002": "met", + "pg.functions.math.cosh.t003": "met", + "pg.functions.math.cot.t001": "met", + "pg.functions.math.cot.t002": "met", + "pg.functions.math.cot.t003": "met", + "pg.functions.math.cotd.t001": "met", + "pg.functions.math.cotd.t002": "met", + "pg.functions.math.cotd.t003": "met", "pg.functions.math.degrees.t001": "met", "pg.functions.math.degrees.t002": "met", "pg.functions.math.degrees.t003": "met", - "pg.functions.math.div.t001": "unmet", - "pg.functions.math.div.t002": "unmet", - "pg.functions.math.div.t003": "unmet", - "pg.functions.math.div.t004": "unmet", + "pg.functions.math.div.t001": "met", + "pg.functions.math.div.t002": "met", + "pg.functions.math.div.t003": "met", + "pg.functions.math.div.t004": "met", "pg.functions.math.erf.t001": "unmet", "pg.functions.math.erf.t002": "unmet", "pg.functions.math.erf.t003": "unmet", @@ -6178,7 +6234,7 @@ "pg.functions.math.erfc.t002": "unmet", "pg.functions.math.erfc.t003": "unmet", "pg.functions.math.exp.t001": "unmet", - "pg.functions.math.exp.t002": "unmet", + "pg.functions.math.exp.t002": "met", "pg.functions.math.exp.t003": "unmet", "pg.functions.math.exp.t004": "unmet", "pg.functions.math.factorial.t001": "met", @@ -6188,9 +6244,9 @@ "pg.functions.math.floor.t002": "met", "pg.functions.math.floor.t003": "met", "pg.functions.math.floor.t004": "met", - "pg.functions.math.gamma.t001": "unmet", - "pg.functions.math.gamma.t002": "unmet", - "pg.functions.math.gamma.t003": "unmet", + "pg.functions.math.gamma.t001": "met", + "pg.functions.math.gamma.t002": "met", + "pg.functions.math.gamma.t003": "met", "pg.functions.math.gcd.t001": "met", "pg.functions.math.gcd.t002": "met", "pg.functions.math.gcd.t003": "met", @@ -6203,19 +6259,19 @@ "pg.functions.math.lcm.t004": "met", "pg.functions.math.lcm.t005": "met", "pg.functions.math.lcm.t006": "met", - "pg.functions.math.lgamma.t001": "unmet", - "pg.functions.math.lgamma.t002": "unmet", - "pg.functions.math.lgamma.t003": "unmet", + "pg.functions.math.lgamma.t001": "met", + "pg.functions.math.lgamma.t002": "met", + "pg.functions.math.lgamma.t003": "met", "pg.functions.math.ln.t001": "unmet", - "pg.functions.math.ln.t002": "unmet", + "pg.functions.math.ln.t002": "met", "pg.functions.math.ln.t003": "unmet", "pg.functions.math.ln.t004": "unmet", "pg.functions.math.log.t001": "unmet", - "pg.functions.math.log.t002": "unmet", + "pg.functions.math.log.t002": "met", "pg.functions.math.log.t003": "unmet", "pg.functions.math.log.t004": "unmet", "pg.functions.math.log10.t001": "unmet", - "pg.functions.math.log10.t002": "unmet", + "pg.functions.math.log10.t002": "met", "pg.functions.math.log10.t003": "unmet", "pg.functions.math.log10.t004": "unmet", "pg.functions.math.min-scale.t001": "unmet", @@ -6229,7 +6285,7 @@ "pg.functions.math.mod.t006": "met", "pg.functions.math.pi.t001": "met", "pg.functions.math.power.t001": "unmet", - "pg.functions.math.power.t002": "unmet", + "pg.functions.math.power.t002": "met", "pg.functions.math.power.t003": "unmet", "pg.functions.math.power.t004": "unmet", "pg.functions.math.power.t005": "unmet", @@ -6247,28 +6303,28 @@ "pg.functions.math.sign.t002": "met", "pg.functions.math.sign.t003": "met", "pg.functions.math.sign.t004": "met", - "pg.functions.math.sin.t001": "unmet", - "pg.functions.math.sin.t002": "unmet", - "pg.functions.math.sin.t003": "unmet", - "pg.functions.math.sind.t001": "unmet", - "pg.functions.math.sind.t002": "unmet", - "pg.functions.math.sind.t003": "unmet", - "pg.functions.math.sinh.t001": "unmet", - "pg.functions.math.sinh.t002": "unmet", - "pg.functions.math.sinh.t003": "unmet", + "pg.functions.math.sin.t001": "met", + "pg.functions.math.sin.t002": "met", + "pg.functions.math.sin.t003": "met", + "pg.functions.math.sind.t001": "met", + "pg.functions.math.sind.t002": "met", + "pg.functions.math.sind.t003": "met", + "pg.functions.math.sinh.t001": "met", + "pg.functions.math.sinh.t002": "met", + "pg.functions.math.sinh.t003": "met", "pg.functions.math.sqrt.t001": "unmet", "pg.functions.math.sqrt.t002": "met", "pg.functions.math.sqrt.t003": "unmet", "pg.functions.math.sqrt.t004": "unmet", - "pg.functions.math.tan.t001": "unmet", - "pg.functions.math.tan.t002": "unmet", - "pg.functions.math.tan.t003": "unmet", - "pg.functions.math.tand.t001": "unmet", - "pg.functions.math.tand.t002": "unmet", - "pg.functions.math.tand.t003": "unmet", - "pg.functions.math.tanh.t001": "unmet", - "pg.functions.math.tanh.t002": "unmet", - "pg.functions.math.tanh.t003": "unmet", + "pg.functions.math.tan.t001": "met", + "pg.functions.math.tan.t002": "met", + "pg.functions.math.tan.t003": "met", + "pg.functions.math.tand.t001": "met", + "pg.functions.math.tand.t002": "met", + "pg.functions.math.tand.t003": "met", + "pg.functions.math.tanh.t001": "met", + "pg.functions.math.tanh.t002": "met", + "pg.functions.math.tanh.t003": "met", "pg.functions.math.trim-scale.t001": "unmet", "pg.functions.math.trim-scale.t002": "unmet", "pg.functions.math.trim-scale.t003": "unmet", @@ -6361,16 +6417,16 @@ "pg.functions.string.overlay-placing-from.t003": "met", "pg.functions.string.overlay-placing-from.t004": "met", "pg.functions.string.overlay-placing-from.t005": "met", - "pg.functions.string.parse-ident.t001": "unmet", - "pg.functions.string.parse-ident.t002": "unmet", - "pg.functions.string.parse-ident.t003": "unmet", + "pg.functions.string.parse-ident.t001": "met", + "pg.functions.string.parse-ident.t002": "met", + "pg.functions.string.parse-ident.t003": "met", "pg.functions.string.position-in.t001": "met", "pg.functions.string.position-in.t002": "met", "pg.functions.string.position-in.t003": "met", "pg.functions.string.position-in.t004": "met", - "pg.functions.string.quote-ident.t001": "unmet", - "pg.functions.string.quote-ident.t002": "unmet", - "pg.functions.string.quote-ident.t003": "unmet", + "pg.functions.string.quote-ident.t001": "met", + "pg.functions.string.quote-ident.t002": "met", + "pg.functions.string.quote-ident.t003": "met", "pg.functions.string.quote-literal.t001": "met", "pg.functions.string.quote-literal.t002": "met", "pg.functions.string.quote-literal.t003": "met", @@ -6391,27 +6447,27 @@ "pg.functions.string.regexp-like.t002": "met", "pg.functions.string.regexp-like.t003": "met", "pg.functions.string.regexp-like.t004": "met", - "pg.functions.string.regexp-match.t001": "unmet", - "pg.functions.string.regexp-match.t002": "unmet", - "pg.functions.string.regexp-match.t003": "unmet", - "pg.functions.string.regexp-match.t004": "unmet", - "pg.functions.string.regexp-matches.t001": "unmet", - "pg.functions.string.regexp-matches.t002": "unmet", - "pg.functions.string.regexp-matches.t003": "unmet", - "pg.functions.string.regexp-matches.t004": "unmet", + "pg.functions.string.regexp-match.t001": "met", + "pg.functions.string.regexp-match.t002": "met", + "pg.functions.string.regexp-match.t003": "met", + "pg.functions.string.regexp-match.t004": "met", + "pg.functions.string.regexp-matches.t001": "met", + "pg.functions.string.regexp-matches.t002": "met", + "pg.functions.string.regexp-matches.t003": "met", + "pg.functions.string.regexp-matches.t004": "met", "pg.functions.string.regexp-replace.t001": "met", "pg.functions.string.regexp-replace.t002": "met", "pg.functions.string.regexp-replace.t003": "met", "pg.functions.string.regexp-replace.t004": "met", "pg.functions.string.regexp-replace.t005": "met", - "pg.functions.string.regexp-split-to-array.t001": "unmet", - "pg.functions.string.regexp-split-to-array.t002": "unmet", - "pg.functions.string.regexp-split-to-array.t003": "unmet", - "pg.functions.string.regexp-split-to-array.t004": "unmet", - "pg.functions.string.regexp-split-to-table.t001": "unmet", - "pg.functions.string.regexp-split-to-table.t002": "unmet", - "pg.functions.string.regexp-split-to-table.t003": "unmet", - "pg.functions.string.regexp-split-to-table.t004": "unmet", + "pg.functions.string.regexp-split-to-array.t001": "met", + "pg.functions.string.regexp-split-to-array.t002": "met", + "pg.functions.string.regexp-split-to-array.t003": "met", + "pg.functions.string.regexp-split-to-array.t004": "met", + "pg.functions.string.regexp-split-to-table.t001": "met", + "pg.functions.string.regexp-split-to-table.t002": "met", + "pg.functions.string.regexp-split-to-table.t003": "met", + "pg.functions.string.regexp-split-to-table.t004": "met", "pg.functions.string.regexp-substr.t001": "met", "pg.functions.string.regexp-substr.t002": "met", "pg.functions.string.regexp-substr.t003": "met", @@ -6448,14 +6504,14 @@ "pg.functions.string.starts-with.t002": "met", "pg.functions.string.starts-with.t003": "met", "pg.functions.string.starts-with.t004": "met", - "pg.functions.string.string-to-array.t001": "unmet", - "pg.functions.string.string-to-array.t002": "unmet", - "pg.functions.string.string-to-array.t003": "unmet", - "pg.functions.string.string-to-array.t004": "unmet", - "pg.functions.string.string-to-table.t001": "unmet", - "pg.functions.string.string-to-table.t002": "unmet", - "pg.functions.string.string-to-table.t003": "unmet", - "pg.functions.string.string-to-table.t004": "unmet", + "pg.functions.string.string-to-array.t001": "met", + "pg.functions.string.string-to-array.t002": "met", + "pg.functions.string.string-to-array.t003": "met", + "pg.functions.string.string-to-array.t004": "met", + "pg.functions.string.string-to-table.t001": "met", + "pg.functions.string.string-to-table.t002": "met", + "pg.functions.string.string-to-table.t003": "met", + "pg.functions.string.string-to-table.t004": "met", "pg.functions.string.strpos.t001": "met", "pg.functions.string.strpos.t002": "met", "pg.functions.string.strpos.t003": "met", @@ -6464,20 +6520,20 @@ "pg.functions.string.substr.t002": "met", "pg.functions.string.substr.t003": "met", "pg.functions.string.substr.t004": "met", - "pg.functions.string.substring-from-for.t001": "unmet", - "pg.functions.string.substring-from-for.t002": "unmet", - "pg.functions.string.substring-from-for.t003": "unmet", - "pg.functions.string.substring-from-for.t004": "unmet", - "pg.functions.string.substring-from-for.t005": "unmet", + "pg.functions.string.substring-from-for.t001": "met", + "pg.functions.string.substring-from-for.t002": "met", + "pg.functions.string.substring-from-for.t003": "met", + "pg.functions.string.substring-from-for.t004": "met", + "pg.functions.string.substring-from-for.t005": "met", "pg.functions.string.substring-from.t001": "met", "pg.functions.string.substring-from.t002": "met", "pg.functions.string.substring-from.t003": "met", "pg.functions.string.substring-from.t004": "met", - "pg.functions.string.substring-similar-escape.t001": "unmet", - "pg.functions.string.substring-similar-escape.t002": "unmet", - "pg.functions.string.substring-similar-escape.t003": "unmet", - "pg.functions.string.substring-similar-escape.t004": "unmet", - "pg.functions.string.substring-similar-escape.t005": "unmet", + "pg.functions.string.substring-similar-escape.t001": "met", + "pg.functions.string.substring-similar-escape.t002": "met", + "pg.functions.string.substring-similar-escape.t003": "met", + "pg.functions.string.substring-similar-escape.t004": "met", + "pg.functions.string.substring-similar-escape.t005": "met", "pg.functions.string.substring.t001": "met", "pg.functions.string.substring.t002": "met", "pg.functions.string.substring.t003": "met", @@ -6513,9 +6569,9 @@ "pg.functions.string.upper.t001": "met", "pg.functions.string.upper.t002": "met", "pg.functions.string.upper.t003": "met", - "pg.functions.uuid.uuid-extract-timestamp.t001": "unmet", - "pg.functions.uuid.uuid-extract-timestamp.t002": "unmet", - "pg.functions.uuid.uuid-extract-timestamp.t003": "unmet", + "pg.functions.uuid.uuid-extract-timestamp.t001": "met", + "pg.functions.uuid.uuid-extract-timestamp.t002": "met", + "pg.functions.uuid.uuid-extract-timestamp.t003": "met", "pg.functions.uuid.uuid-extract-version.t001": "met", "pg.functions.uuid.uuid-extract-version.t002": "met", "pg.functions.uuid.uuid-extract-version.t003": "met", diff --git a/coverage/translation-postgres/reviews/results.toml b/coverage/translation-postgres/reviews/results.toml index 3b629d85e..686bfbaa6 100644 --- a/coverage/translation-postgres/reviews/results.toml +++ b/coverage/translation-postgres/reviews/results.toml @@ -1,2 +1,50 @@ # Sign-offs of the result-matching measure's link map and not-translatable groups. The link map -# in form-links.toml and the function links are unreviewed. +# in form-links.toml and the function links are unreviewed; the eight not-translatable groups are signed. + +[[signoff]] +subject = "not-translatable:catalogue-and-server-state" +sha256 = "af95a62940fa6956b9aa09ca3f11b3661ad8ab76dfcb49e5ab050899eb7314b8" +scope = "full" +reviewed_utc = "2026-11-30T10:20:00Z" + +[[signoff]] +subject = "not-translatable:maintenance-cursors-and-files" +sha256 = "7f0035fa02eb8d5a902e0f5adb214f8a997a4f78c4c561161aa8fb257d9754b4" +scope = "full" +reviewed_utc = "2026-11-30T10:20:00Z" + +[[signoff]] +subject = "not-translatable:object-kinds-duckdb-lacks" +sha256 = "ada632897f0dca23006a66d23c3549618e991bd5049ceed122002a4e5b67c39e" +scope = "full" +reviewed_utc = "2026-11-30T08:28:06Z" + +[[signoff]] +subject = "not-translatable:procedural" +sha256 = "713f3926c56048f61dbaac2f6408e5c3bb0f770472d42e2cd944e0479b2cdc41" +scope = "full" +reviewed_utc = "2026-11-30T08:28:06Z" + +[[signoff]] +subject = "not-translatable:security-and-roles" +sha256 = "483ab8d304f1c441f552e3d350cfe22cd7b9ef26f2679d6f36710c2dec232c84" +scope = "full" +reviewed_utc = "2026-11-30T10:05:08Z" + +[[signoff]] +subject = "not-translatable:session-and-randomness" +sha256 = "131be1bf69cfe471daee34fc9d73196cc3e79ce52d14a1ddb47c64dbabaf81ec" +scope = "full" +reviewed_utc = "2026-11-30T10:05:08Z" + +[[signoff]] +subject = "not-translatable:text-search" +sha256 = "d78259c7cdf44d98bd996390bd730a04f884653228a76024c71297c6bb91d7d8" +scope = "full" +reviewed_utc = "2026-11-30T08:28:06Z" + +[[signoff]] +subject = "not-translatable:xml" +sha256 = "9a30b00bafddf5cf43154475c660f40b73b39fb64c16ddeca3aa1336aefdefea" +scope = "full" +reviewed_utc = "2026-11-30T10:05:08Z" diff --git a/coverage/translation/README.md b/coverage/translation/README.md index 584257280..5f68df554 100644 --- a/coverage/translation/README.md +++ b/coverage/translation/README.md @@ -14,6 +14,12 @@ separately from syntax coverage, and every figure comes from the checker. rest, and lists the constructs that name no form of their own. A `[[link]]` with `except_within_ulps = true` skips statements matching only within ULPs: they count neither for nor against its forms, while every other statement it links still does. +- `argument-types.toml` (optional): for a function name several forms share, the type families + each form's first argument takes (`[[form]]` with `id` and `first`), as the dialect's converter + names them. A statement recording its calls with their argument types links a call only to the + listed forms whose families hold its first argument; a form the file does not list, and a call + the statement records no types for, still link by name. The families are part of the + function-links index the review signs. - `not-translatable.toml`: forms with no meaningful DuckDB translation, in groups, each with its reason. A group leaves the denominator only once a reviewer signs it off in `reviews/results.toml`, which binds its reason and forms by SHA-256. diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/catalog.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/catalog.rs index b71fd510a..d69df0690 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/catalog.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/catalog.rs @@ -46,7 +46,7 @@ impl Catalog { .ok_or_else(|| { refused( "table", - format!("`{name}` is no table the case's statements define"), + format!("this script doesn't define table `{name}`"), ) }) } @@ -59,7 +59,7 @@ impl Catalog { .ok_or_else(|| { refused( "table", - format!("`{name}` is no table the case's statements define"), + format!("this script doesn't define table `{name}`"), ) }) } diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/rows.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/rows.rs index 885d1106a..fdb1ff5ed 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/rows.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/rows.rs @@ -305,7 +305,7 @@ pub(crate) fn execute( else { return Err(refused( "execute", - format!("`{name}` is no statement the case prepared"), + format!("this script doesn't prepare a statement named `{name}`"), )); }; let arguments = list(execute, "arguments"); diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/statements.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/statements.rs index 878289658..9be3005ef 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/statements.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/effects/statements.rs @@ -61,7 +61,7 @@ fn converted( "utility_statement" => utility(payload, (catalog, log)), kind => Err(refused( kind, - format!("no rule converts a {kind} statement in an effect case"), + format!("no rule converts a {kind} statement"), )), } } diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bits.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bits.rs index 2319a7d43..3cca1401a 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bits.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bits.rs @@ -12,12 +12,15 @@ use crate::postgres::conversion::_helpers::expressions::json::{json_contains, js use crate::postgres::conversion::_helpers::expressions::literals::typed; use crate::postgres::conversion::_helpers::expressions::operators::coerced; use crate::postgres::conversion::_helpers::expressions::patterns::regex_operator; +use crate::postgres::conversion::_helpers::functions::floats::float_function; use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::{ field, identifier, node_kind, outside, refused, understood, }; use crate::postgres::conversion::_helpers::support::typing::wider_integer; -use crate::postgres::conversion::constants::{BITWISE_RULE, PATTERN_OPERATORS}; +use crate::postgres::conversion::constants::{ + BITWISE_RULE, NUMBER_FUNCTION_RULE, PATTERN_OPERATORS, +}; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; /// A named operator, `x y`, such as `&`, `|` or `#`. @@ -57,6 +60,14 @@ pub(crate) fn operator(payload: &Value, site: Site<'_>) -> Result { + let left = expression(field(operator, "this"), site)?; + let right = expression(field(operator, "expression"), site)?; + let _rule = site.log.rule(NUMBER_FUNCTION_RULE); + return float_function("power", &[left, right]).unwrap_or_else(|| { + Err(refused(&kind, "no rule converts the ^ operator".to_owned())) + }); + } "&&" | "@>" | "<@" => { let left = expression(field(operator, "this"), site)?; let right = expression(field(operator, "expression"), site)?; diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bitstrings.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bitstrings.rs index 83bd87747..c9a5fa60e 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bitstrings.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/bitstrings.rs @@ -414,6 +414,7 @@ pub(crate) fn bit_function( | "position" | "overlay", _, ) => wrong(), + ("substring", [_]) => wrong(), _ => Err(refused_function( name, format!("no rule converts {name} of a bit string"), diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/encodings.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/encodings.rs new file mode 100644 index 000000000..b51400254 --- /dev/null +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/encodings.rs @@ -0,0 +1,205 @@ +//! `convert_from`, `convert_to` and `convert` between text and the bytes of UTF8 or LATIN1, PostgreSQL's checks written out; any other encoding raises unread. + +use sqlbabel_diagnostics::refusals::models::Refusal; + +use crate::postgres::conversion::_helpers::expressions::bitstrings::rejected; +use crate::postgres::conversion::_helpers::expressions::literals::{quoted_text, typed}; +use crate::postgres::conversion::_helpers::expressions::strings::{ + is_text_like, literal_text, text_sql, +}; +use crate::postgres::conversion::_helpers::support::scope::Site; +use crate::postgres::conversion::_helpers::support::tree::{outside_function, refused_function}; +use crate::postgres::conversion::constants::{ + BYTEA_RULE, ENCODING_FUNCTIONS, INVALID_BYTES_ERROR, LATIN1_NAMES, UNMAPPED_CHARACTER_ERROR, + UNREAD_ENCODING_ERROR, UTF8_NAMES, +}; +use crate::postgres::conversion::models::{Emitted, PostgresType}; + +/// An encoding a rule reads. +#[derive(Clone, Copy, PartialEq, Eq)] +enum Coding { + Utf8, + Latin1, +} + +/// Which encoding an argument names: known now for a literal, else read from the column at run time. +#[derive(Clone)] +enum Named { + Known(Coding), + Column(String), +} + +/// `convert_from(bytes, encoding)`, `convert_to(text, encoding)` or `convert(bytes, from, to)`; `None` for another name. +pub(crate) fn encoding_function( + name: &str, + args: &[Emitted], + site: Site<'_>, +) -> Option> { + if !ENCODING_FUNCTIONS.contains(&name) { + return None; + } + let _rule = site.log.rule(BYTEA_RULE); + Some(encoding_call(name, args)) +} + +/// One encoding function of its converted arguments. +fn encoding_call(name: &str, args: &[Emitted]) -> Result { + use PostgresType as T; + let bytes = |value: &Emitted| matches!(value.data_type, T::Bytea | T::Null); + let wrong = || { + outside_function( + name, + format!( + "PostgreSQL has no {name} of {}", + args.iter() + .map(|value| value.data_type.name()) + .collect::>() + .join(", ") + ), + ) + }; + if args.iter().any(|value| value.data_type == T::Null) { + let data_type = match name { + "convert_from" => T::Text, + _ => T::Bytea, + }; + return Ok(typed( + format!("CAST(NULL AS {})", data_type.duckdb_name()), + data_type, + )); + } + match (name, args) { + ("convert_from", [b, e]) if bytes(b) && is_text_like(e) => { + let coding = named(name, e)?; + Ok(typed( + guard(&[b, e], &[&coding], &decoded(&b.sql, &coding)), + T::Text, + )) + } + ("convert_to", [x, e]) if is_text_like(x) && is_text_like(e) => { + let coding = named(name, e)?; + Ok(typed( + guard(&[x, e], &[&coding], &encoded(&text_sql(x), &coding)), + T::Bytea, + )) + } + ("convert", [b, from, to]) if bytes(b) && is_text_like(from) && is_text_like(to) => { + let (source, target) = (named(name, from)?, named(name, to)?); + let body = format!( + "list_apply([{}], lambda t: {})[1]", + decoded(&b.sql, &source), + encoded("t", &target) + ); + Ok(typed( + guard(&[b, from, to], &[&source, &target], &body), + T::Bytea, + )) + } + _ => Err(wrong()), + } +} + +/// The encoding a name argument gives, as PostgreSQL's lookup reads it: case and every character but letters and digits ignored. A literal naming another encoding is refused. +fn named(name: &str, value: &Emitted) -> Result { + let Some(text) = literal_text(value) else { + return Ok(Named::Column(text_sql(value))); + }; + let cleaned: String = text + .chars() + .filter(char::is_ascii_alphanumeric) + .collect::() + .to_ascii_lowercase(); + match cleaned.as_str() { + known if UTF8_NAMES.contains(&known) => Ok(Named::Known(Coding::Utf8)), + known if LATIN1_NAMES.contains(&known) => Ok(Named::Known(Coding::Latin1)), + _ => Err(refused_function( + name, + format!("no rule converts the encoding {text:?}, only UTF8 and LATIN1"), + )), + } +} + +/// The SQL test of a name a column holds: whether it names `coding`. +fn names(sql: &str, coding: Coding) -> String { + let listed = match coding { + Coding::Utf8 => UTF8_NAMES, + Coding::Latin1 => LATIN1_NAMES, + }; + let listed: Vec = listed.iter().map(|known| quoted_text(known)).collect(); + format!( + "lower(regexp_replace({sql}, '[^A-Za-z0-9]', '', 'g')) IN ({})", + listed.join(", ") + ) +} + +/// `body` NULL where an argument is, and raising unread where a column names an encoding no rule reads, before any byte is read, as PostgreSQL looks the names up first. +fn guard(args: &[&Emitted], codings: &[&Named], body: &str) -> String { + let nulls: Vec = args + .iter() + .filter(|value| value.literal.is_none()) + .map(|value| format!("{} IS NULL", value.sql)) + .collect(); + let unread: Vec = codings + .iter() + .filter_map(|coding| match coding { + Named::Column(sql) => Some(format!( + "NOT ({} OR {})", + names(sql, Coding::Utf8), + names(sql, Coding::Latin1) + )), + Named::Known(_) => None, + }) + .collect(); + let mut whens: Vec = Vec::new(); + if !nulls.is_empty() { + whens.push(format!("WHEN {} THEN NULL", nulls.join(" OR "))); + } + if !unread.is_empty() { + whens.push(format!( + "WHEN {} THEN error({})", + unread.join(" OR "), + quoted_text(UNREAD_ENCODING_ERROR) + )); + } + match whens.is_empty() { + true => body.to_owned(), + false => format!("(CASE {} ELSE {body} END)", whens.join(" ")), + } +} + +/// Bytes read as text in `coding`: a zero byte, which no text holds, and bytes UTF8 does not read raise as PostgreSQL's check does; LATIN1 maps each byte to its code point. +fn decoded(b: &str, coding: &Named) -> String { + let invalid = format!("error({})", rejected(INVALID_BYTES_ERROR)); + let pairs = format!("regexp_extract_all(hex({b}), '..')"); + let utf8 = format!("CASE WHEN try(decode({b})) IS NULL THEN {invalid} ELSE decode({b}) END"); + let latin1 = format!( + "array_to_string(list_transform({pairs}, lambda h: chr(CAST('0x' || h AS INTEGER))), '')" + ); + let read = match coding { + Named::Known(Coding::Utf8) => utf8, + Named::Known(Coding::Latin1) => latin1, + Named::Column(sql) => format!( + "CASE WHEN {} THEN {utf8} ELSE {latin1} END", + names(sql, Coding::Utf8) + ), + }; + format!("(CASE WHEN list_contains({pairs}, '00') THEN {invalid} ELSE {read} END)") +} + +/// Text written as bytes in `coding`: UTF8 as DuckDB holds it; LATIN1 each character's code point as one byte, raising for a character above U+00FF. +fn encoded(x: &str, coding: &Named) -> String { + let utf8 = format!("encode({x})"); + let latin1 = format!( + "CASE WHEN regexp_matches({x}, '[^\\x01-\\xff]') THEN error({}) WHEN {x} = '' THEN CAST('' AS BLOB) \ + ELSE unhex(array_to_string(list_transform(string_split({x}, ''), lambda c: printf('%02x', unicode(c))), '')) END", + rejected(UNMAPPED_CHARACTER_ERROR) + ); + match coding { + Named::Known(Coding::Utf8) => utf8, + Named::Known(Coding::Latin1) => format!("({latin1})"), + Named::Column(sql) => format!( + "(CASE WHEN {} THEN {utf8} ELSE {latin1} END)", + names(sql, Coding::Utf8) + ), + } +} diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/fields.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/fields.rs index 92f3152bf..c82974606 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/fields.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/fields.rs @@ -7,9 +7,9 @@ use crate::postgres::conversion::_helpers::expressions::literals::typed; use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::outside_function; use crate::postgres::conversion::constants::{ - DATETIME_RULE, DELTA_UNITS, MICROS_PER_HOUR, MICROS_PER_MINUTE, MICROS_PER_SECOND, - MIN_TIMESTAMP_MICROS, SPECIAL_UNITS, TIMESTAMP_RANGE_ERROR, UNIT_ERROR, UNIT_TOKEN_LENGTH, - UNREAD_DELTA_UNITS, UNREAD_SPECIAL_UNITS, UNREAD_UNIT_ERROR, + DATETIME_RULE, DELTA_UNITS, INFINITE_FIELD_ERROR, MICROS_PER_HOUR, MICROS_PER_MINUTE, + MICROS_PER_SECOND, MIN_TIMESTAMP_MICROS, SPECIAL_UNITS, TIMESTAMP_RANGE_ERROR, UNIT_ERROR, + UNIT_TOKEN_LENGTH, UNREAD_DELTA_UNITS, UNREAD_SPECIAL_UNITS, UNREAD_UNIT_ERROR, }; use crate::postgres::conversion::models::{DateUnit, Emitted, Literal, PostgresType}; @@ -175,7 +175,7 @@ fn unread_tokens(usage: Use) -> Vec<&'static str> { tokens } -/// `field` of the source as the function gives it, `None` where no rule converts it: `extract`'s fractions, and its rising fields of a timestamp, an infinite one giving a numeric infinity DuckDB holds none of. +/// `field` of the source as the function gives it, `None` where no rule converts it: `extract`'s fractions. Its rising fields of an infinite timestamp, a numeric infinity DuckDB holds none of, raise. fn field_sql(field: DateUnit, source: &Source<'_>, usage: Use) -> Option { match (source, usage) { (Source::Stamp { at, value }, Use::Trunc) => stamp_trunc(field, at, value), @@ -197,7 +197,11 @@ fn field_sql(field: DateUnit, source: &Source<'_>, usage: Use) -> Option "(CASE WHEN {value} = 'infinity' THEN CAST('Infinity' AS DOUBLE) \ WHEN {value} = '-infinity' THEN CAST('-Infinity' AS DOUBLE) ELSE CAST({part} AS DOUBLE) END)" )), - (_, true) => None, + (_, true) if fractional(field) => None, + (_, true) => Some(format!( + "(CASE WHEN isinf({value}) THEN CAST(error('{INFINITE_FIELD_ERROR}') AS {name}) ELSE CAST({part} AS {name}) END)", + name = EXTRACTED.duckdb_name() + )), (_, false) if fractional(field) => None, (_, false) => Some(format!("CAST({part} AS {})", EXTRACTED.duckdb_name())), } diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/json.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/json.rs index 6be018ff9..7321e4116 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/json.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/json.rs @@ -13,10 +13,12 @@ use crate::postgres::conversion::_helpers::support::tree::{ understood, }; use crate::postgres::conversion::constants::{ - ABSENT_ON_NULL, JSON_CONTROLS, JSON_FIRST_PRINTABLE, JSON_FUNCTIONS, JSON_INDEX_STEP, - JSON_LENIENT, JSON_MAX_DEPTH, JSON_MAX_DIGITS, JSON_RESPACE, JSON_RULE, JSON_STRING, - JSON_SURROGATE, JSON_TEXT_ERROR, JSONB_UNHELD_ESCAPES, JSONB_UNHELD_TOKENS, MINUS_ZERO_DIGITS, - OPTION_NODE, UNREAD_JSON_ERROR, UNREAD_JSON_TEXT_ERROR, ZERO_DIGITS, + ABSENT_ON_NULL, EMPTY_CONTAINER, JSON_CONTROLS, JSON_FIRST_PRINTABLE, JSON_FUNCTIONS, + JSON_INDEX_STEP, JSON_LENIENT, JSON_MAX_DEPTH, JSON_MAX_DIGITS, JSON_RESPACE, + JSON_REWRITTEN_TOKENS, JSON_RULE, JSON_STRING, JSON_SURROGATE, JSON_TEXT_ERROR, + JSON_UNICODE_ESCAPE, JSONB_UNHELD_ESCAPES, JSONB_UNHELD_TOKENS, LAST_NULL_MEMBER, + MINUS_ZERO_DIGITS, NULL_KEY_ERROR, NULL_MEMBER, OPTION_NODE, UNREAD_JSON_ERROR, + UNREAD_JSON_TEXT_ERROR, ZERO_DIGITS, }; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; @@ -772,6 +774,13 @@ pub(crate) fn json_function( Some(json_call(name, &args).map_err(|refusal| outside_function(name, refusal.reason))) } +/// Minified JSON text without the object members whose value is JSON null, at any depth: those a comma follows, then each object's last. +fn strip_nulls(text: &str) -> String { + format!( + "regexp_replace(regexp_replace({text}, '{NULL_MEMBER}', '\\1', 'g'), '{LAST_NULL_MEMBER}', '\\1\\2', 'g')" + ) +} + /// One JSON function of converted arguments. fn json_call(name: &str, args: &[Argument]) -> Result { use PostgresType as T; @@ -797,6 +806,32 @@ fn json_call(name: &str, args: &[Argument]) -> Result { ) }; match (name, values.as_slice()) { + ("json_strip_nulls", [x]) if matches!(x.data_type, T::Json | T::JsonText) && !variadic => { + let between = format!("regexp_replace({}, '{JSON_STRING}', '\"\"', 'g')", x.sql); + Ok(typed( + format!( + "(CASE WHEN regexp_matches({between}, '{JSON_REWRITTEN_TOKENS}') \ + OR regexp_matches({}, '{JSON_UNICODE_ESCAPE}') THEN error('{UNREAD_JSON_ERROR}') ELSE {} END)", + x.sql, + strip_nulls(&format!("CAST(json({}) AS VARCHAR)", x.sql)) + ), + T::JsonText, + )) + } + ("jsonb_strip_nulls", [x]) if x.data_type == T::Jsonb && !variadic => Ok(typed( + format!( + "CAST({} AS JSON)", + strip_nulls(&format!("CAST({} AS VARCHAR)", x.sql)) + ), + T::Jsonb, + )), + ("jsonb_pretty", [x]) if x.data_type == T::Jsonb && !variadic => Ok(typed( + format!( + "regexp_replace(json_pretty({}), '{EMPTY_CONTAINER}', '\\1\\2\\3\\4' || chr(10) || '\\2\\5', 'g')", + x.sql + ), + T::Text, + )), ("json_typeof" | "jsonb_typeof", [x]) if typed_for(x) && !variadic => { let kind = format!("json_type({})", x.sql); Ok(typed( @@ -940,7 +975,7 @@ fn controls_check(text: &str, value: &Emitted) -> Vec<(String, String)> { } /// `to_json`, `to_jsonb`, `array_to_json` and `json_scalar` of a number, boolean, text or array, or a JSON value as itself. -fn to_json(value: &Emitted, target: PostgresType) -> Option { +pub(crate) fn to_json(value: &Emitted, target: PostgresType) -> Option { use PostgresType as T; let x = &value.sql; match value.data_type { @@ -975,7 +1010,7 @@ fn pairs(array: &Emitted, odd: &str, jsonb: bool) -> Emitted { (format!("len({x}) % 2 = 1"), rejected(odd)), ( format!("list_bool_or(list_transform({starts}, lambda i: {x}[i] IS NULL))"), - rejected("null value not allowed for object key"), + rejected(NULL_KEY_ERROR), ), ]; checks.extend(controls_check(&format!("array_to_string({x}, '')"), array)); diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/literals.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/literals.rs index f47215e83..5a42016cf 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/literals.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/literals.rs @@ -10,7 +10,9 @@ use crate::postgres::conversion::_helpers::expressions::dispatch::expression; use crate::postgres::conversion::_helpers::expressions::json::cast_from_json; use crate::postgres::conversion::_helpers::expressions::texts::{read_text, text_value}; use crate::postgres::conversion::_helpers::support::scope::Site; -use crate::postgres::conversion::_helpers::support::tree::{field, node_kind, refused, understood}; +use crate::postgres::conversion::_helpers::support::tree::{ + field, node_kind, outside, refused, understood, +}; use crate::postgres::conversion::_helpers::support::typing::{ CastTarget, as_numeric, cast_target, refused_cast, same_cast, }; @@ -372,9 +374,17 @@ pub(crate) fn negated(operand: Emitted) -> Result { { Ok(typed(format!("(- {})", operand.sql), data_type)) } - other => Err(refused( + _ if operand.data_type == PostgresType::Null + || matches!(operand.literal, Some(Literal::Text(_))) => + { + Err(outside( + "neg", + "PostgreSQL cannot choose a unary - for an untyped string or NULL".to_owned(), + )) + } + other => Err(outside( "neg", - format!("no rule negates a {}, which is not a number", other.name()), + format!("PostgreSQL has no unary - of {}", other.name()), )), } } diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/mod.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/mod.rs index a0257dc43..16a1b93c5 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/mod.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/mod.rs @@ -4,6 +4,7 @@ pub(crate) mod bitstrings; pub(crate) mod bytes; pub(crate) mod datetimes; pub(crate) mod dispatch; +pub(crate) mod encodings; pub(crate) mod fields; pub(crate) mod json; pub(crate) mod literals; diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/operators.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/operators.rs index 28337f511..7f693a589 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/operators.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/operators.rs @@ -249,20 +249,29 @@ pub(crate) fn float_arithmetic( )), _ => {} } + Ok(guarded(checks, result, target)) +} + +/// `result` behind checks taken in order, each raising its error where all its conditions hold: the error alone when one always holds. +pub(crate) fn guarded( + checks: Vec<(Option>, &str)>, + result: String, + target: PostgresType, +) -> Emitted { let mut whens: Vec = Vec::new(); for (conditions, error) in checks { let Some(conditions) = conditions else { continue; }; if conditions.is_empty() { - return Ok(typed( + return typed( format!( "CAST(error({}) AS {})", quoted_text(error), target.duckdb_name() ), target, - )); + ); } whens.push(format!( "WHEN {} THEN error({})", @@ -274,11 +283,11 @@ pub(crate) fn float_arithmetic( true => result, false => format!("(CASE {} ELSE {result} END)", whens.join(" ")), }; - Ok(typed(sql, target)) + typed(sql, target) } /// The conditions of a check, `None` when one part can never hold, so the check never fires; an empty list always fires. -fn check_conditions(parts: Vec>) -> Option> { +pub(crate) fn check_conditions(parts: Vec>) -> Option> { let parts: Vec = parts.into_iter().collect::>>()?; Some(parts.into_iter().filter(|part| !part.is_empty()).collect()) } diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/patterns.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/patterns.rs index eb71536ad..8ab673b3c 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/patterns.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/patterns.rs @@ -13,11 +13,14 @@ use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::{ field, flag, outside, refused, refused_function, understood, }; +use sqlbabel_diagnostics::failures::constants::ARGUMENT_REJECTED; + use crate::postgres::conversion::constants::{ - ARE_DIRECTOR, ASCII_LOWER, ASCII_UPPER, DOT_MATCHES_NEWLINE, ILIKE_KIND, + ARE_DIRECTOR, ASCII_LOWER, ASCII_UPPER, DOT_MATCHES_NEWLINE, ILIKE_KIND, INVALID_ESCAPE_ERROR, PATTERN_OPERATOR_CHARACTERS, PATTERN_OPERATOR_TEST, PATTERN_RULE, PREFIX_OPERATOR, REGEX_ARITY, - REGEX_FUNCTIONS, REGEX_GROUP_OPTIONS, SUBSTRING_FUNCTION, UNMATCHED_REGEX_CHARACTERS, - UNMATCHED_REGEX_TEST, UNREAD_PATTERN_ERROR, UNREAD_REPLACEMENT_ERROR, + REGEX_FUNCTIONS, REGEX_GROUP_OPTIONS, SPLIT_ANCHORS, SPLIT_PATTERN_TEST, SUBSTRING_FUNCTION, + UNMATCHED_REGEX_CHARACTERS, UNMATCHED_REGEX_TEST, UNREAD_PATTERN_ERROR, + UNREAD_REPLACEMENT_ERROR, }; use crate::postgres::conversion::models::{Emitted, PostgresType}; @@ -28,6 +31,8 @@ enum Reading { Test, /// An extraction: only text, `.`, `^` and `$`, so every match at a position has one length and RE2 and ARE pick the same one. Extract, + /// A split: an extraction's text without `^` or `$`, whose empty matches RE2 splits at and ARE does not. + Split, } /// Whether a literal pattern holds what no rule reads for `reading`. @@ -40,6 +45,9 @@ fn unread(pattern: &str, reading: Reading) -> bool { || quantified_anchor(pattern) } Reading::Extract => pattern.contains(PATTERN_OPERATOR_CHARACTERS), + Reading::Split => { + pattern.contains(PATTERN_OPERATOR_CHARACTERS) || pattern.contains(SPLIT_ANCHORS) + } } } @@ -56,6 +64,7 @@ fn unread_test(reading: Reading) -> &'static str { match reading { Reading::Test => UNMATCHED_REGEX_TEST, Reading::Extract => PATTERN_OPERATOR_TEST, + Reading::Split => SPLIT_PATTERN_TEST, } } @@ -324,20 +333,32 @@ pub(crate) fn pattern_function( args: &[Emitted], site: Site<'_>, ) -> Option> { + let text = |value: &Emitted| { + matches!( + value.data_type, + PostgresType::Text + | PostgresType::Varchar + | PostgresType::Name + | PostgresType::Bpchar { .. } + ) + }; let regex_substring = name == SUBSTRING_FUNCTION - && matches!(args, [_, pattern] if matches!(pattern.data_type, PostgresType::Text | PostgresType::Varchar | PostgresType::Name | PostgresType::Bpchar { .. })); + && matches!(args, [_, pattern] | [_, pattern, _] if text(pattern)) + && args + .get(2) + .is_none_or(|escape| text(escape) || escape.data_type == PostgresType::Null); if !(REGEX_FUNCTIONS.contains(&name) || regex_substring) { return None; } let _rule = site.log.rule(PATTERN_RULE); - Some(pattern_call(name, args)) + Some(pattern_call(name, name, args)) } -/// One regular expression function. -fn pattern_call(name: &str, args: &[Emitted]) -> Result { +/// One regular expression or splitting function, `name` as written and `function` the scalar it computes as. +fn pattern_call(name: &str, function: &str, args: &[Emitted]) -> Result { let within = REGEX_ARITY .iter() - .any(|(function, most)| *function == name && (2..=*most).contains(&args.len())); + .any(|(known, most)| *known == name && (2..=*most).contains(&args.len())); if !args.iter().all(matchable) { let taken = args.iter().take(2).all(is_text_like) && args @@ -349,7 +370,7 @@ fn pattern_call(name: &str, args: &[Emitted]) -> Result { }); } let sqls: Vec = args.iter().map(text_sql).collect(); - match (name, args) { + match (function, args) { ("regexp_like", [_, pattern]) => { let (p, test) = regex(name, pattern, (Reading::Test, "", false))?; Ok(typed( @@ -445,11 +466,163 @@ fn pattern_call(name: &str, args: &[Emitted]) -> Result { PostgresType::Text, )) } + ("substring", [_, pattern, escape]) => similar_substring( + (&args[0], &sqls[0]), + (pattern, &sqls[1]), + (escape, &sqls[2]), + ), + ("regexp_match" | "regexp_split_to_array", [_, _]) + if args + .iter() + .any(|value| value.data_type == PostgresType::Null) => + { + Ok(typed( + "CAST(NULL AS VARCHAR[])".to_owned(), + PostgresType::TextArray, + )) + } + ("regexp_match", [_, pattern]) => { + let (p, test) = regex(name, pattern, (Reading::Extract, "", false))?; + let x = &sqls[0]; + Ok(typed( + read_only( + args, + test, + &format!( + "(CASE WHEN regexp_matches({x}, {p}) THEN [regexp_extract({x}, {p})] END)" + ), + "VARCHAR[]", + ), + PostgresType::TextArray, + )) + } + ("regexp_split_to_array", [_, pattern]) => { + let (p, test) = regex(name, pattern, (Reading::Split, "", false))?; + let checks: Vec<(String, String)> = test + .into_iter() + .map(|test| (test, quoted_text(UNREAD_PATTERN_ERROR))) + .collect(); + Ok(typed( + guarded( + args, + &checks, + &format!("string_split_regex({}, {p})", sqls[0]), + "VARCHAR[]", + ), + PostgresType::TextArray, + )) + } + ("string_to_array", [_, delimiter]) => Ok(typed( + string_to_array(&sqls[0], delimiter, &sqls[1]), + PostgresType::TextArray, + )), _ if within => Err(untaken(name)), _ => Err(wrong(name, args)), } } +/// `substring(x SIMILAR p ESCAPE e)`, also written `substring(x FROM p FOR e)`: `x` where it matches the whole pattern, which LIKE reads alike while the pattern holds no regular expression operator and no escape. An escape of more than one character raises: always when the pattern and escape are literals, which PostgreSQL's planner folds, else only on a row where no argument is NULL. +fn similar_substring( + (value, x): (&Emitted, &str), + (pattern, p): (&Emitted, &str), + (escape, e): (&Emitted, &str), +) -> Result { + let name = SUBSTRING_FUNCTION; + let escape_text = literal_text(escape); + if let Some(text) = literal_text(pattern) + && (text.contains(PATTERN_OPERATOR_CHARACTERS) + || escape_text.is_some_and(|written| !written.is_empty() && text.contains(written))) + { + return Err(refused_function( + name, + format!( + "no rule reads the SIMILAR pattern `{text}` with its escape as PostgreSQL does" + ), + )); + } + let raise = |message: &str| format!("CAST(error({}) AS VARCHAR)", quoted_text(message)); + let invalid = raise(&format!("{ARGUMENT_REJECTED}: {INVALID_ESCAPE_ERROR}")); + let long_escape = escape_text.is_some_and(|written| written.chars().count() > 1); + if long_escape && pattern.literal.is_some() { + return Ok(typed(invalid, PostgresType::Text)); + } + if [value, pattern, escape] + .iter() + .any(|argument| argument.data_type == PostgresType::Null) + { + return Ok(typed( + "CAST(NULL AS VARCHAR)".to_owned(), + PostgresType::Text, + )); + } + let nulls: Vec = [(value, x), (pattern, p), (escape, e)] + .iter() + .filter(|(argument, _)| argument.literal.is_none()) + .map(|(_, sql)| format!("{sql} IS NULL")) + .collect(); + let mut whens: Vec<(String, String)> = Vec::new(); + if !nulls.is_empty() { + whens.push((nulls.join(" OR "), "NULL".to_owned())); + } + if long_escape { + whens.push(("TRUE".to_owned(), invalid)); + return Ok(typed(case_of(&whens), PostgresType::Text)); + } + if escape_text.is_none() { + whens.push((format!("length({e}) > 1"), invalid)); + } + let unread = match (literal_text(pattern), escape_text) { + (Some(_), Some(_)) => None, + (Some(_), None) => Some(format!("{e} <> '' AND strpos({p}, {e}) > 0")), + (None, Some("")) => Some(format!("regexp_matches({p}, '{PATTERN_OPERATOR_TEST}')")), + (None, Some(_)) => Some(format!( + "regexp_matches({p}, '{PATTERN_OPERATOR_TEST}') OR strpos({p}, {e}) > 0" + )), + (None, None) => Some(format!( + "regexp_matches({p}, '{PATTERN_OPERATOR_TEST}') OR ({e} <> '' AND strpos({p}, {e}) > 0)" + )), + }; + if let Some(test) = unread { + whens.push((test, raise(UNREAD_PATTERN_ERROR))); + } + let clause = match escape_text { + Some("") => " ESCAPE ''".to_owned(), + Some(written) if literal_text(pattern).is_some_and(|text| !text.contains(written)) => { + String::new() + } + _ => format!(" ESCAPE {e}"), + }; + whens.push((format!("{x} LIKE {p}{clause}"), x.to_owned())); + Ok(typed(case_of(&whens), PostgresType::Text)) +} + +/// A searched CASE of `whens`, each a test and its result, NULL where none holds. +fn case_of(whens: &[(String, String)]) -> String { + let cases: Vec = whens + .iter() + .map(|(test, result)| format!("WHEN {test} THEN {result}")) + .collect(); + format!("(CASE {} END)", cases.join(" ")) +} + +/// `string_to_array(x, d)`: no elements for empty text, its characters for a NULL delimiter, the whole text for an empty one; the branch chosen now for a literal delimiter. +fn string_to_array(x: &str, delimiter: &Emitted, d: &str) -> String { + let empty = "CAST([] AS VARCHAR[])"; + let split = match literal_text(delimiter) { + Some("") => format!("[{x}]"), + Some(_) => format!("string_split({x}, {d})"), + None => format!( + "CASE WHEN {d} IS NULL THEN string_split({x}, '') WHEN {d} = '' THEN [{x}] ELSE string_split({x}, {d}) END" + ), + }; + format!("(CASE WHEN {x} IS NULL THEN NULL WHEN {x} = '' THEN {empty} ELSE {split} END)") +} + +/// The list a set-returning split or match call unnests, `name` its set form: `regexp_matches`, `regexp_split_to_table` or `string_to_table`. +pub(crate) fn split_list(name: &str, list: &str, args: &[Emitted]) -> Result { + pattern_call(name, list, args) +} + /// The refusal of a regular expression call PostgreSQL takes and no rule converts: one with `character(n)`, flags, a start or an occurrence. fn untaken(name: &str) -> Refusal { refused_function( diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/strings.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/strings.rs index 8fc042e30..1e292c8c0 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/strings.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/expressions/strings.rs @@ -12,10 +12,12 @@ use crate::postgres::conversion::_helpers::support::tree::{ }; use crate::postgres::conversion::constants::{ ASCII_LOWER, ASCII_UPPER, BIGINT_BITS_MASK, C_COLLATIONS, CHARACTER_LIMIT_ERROR, - CHARACTER_NUMBER_ERROR, FIELD_POSITION_ERROR, FIRST_SURROGATE, FORMAT_ARGUMENTS_ERROR, - INITCAP_WORDS, INTEGER_BITS_MASK, INTEGER_OVERFLOW_ERROR, LAST_SURROGATE, LENGTH_LIMIT_ERROR, + CHARACTER_NUMBER_ERROR, DOTTED_IDENTIFIERS, FIELD_POSITION_ERROR, FIRST_SURROGATE, + FORMAT_ARGUMENTS_ERROR, IDENTIFIER_WORD, INITCAP_WORDS, INTEGER_BITS_MASK, + INTEGER_OVERFLOW_ERROR, INVALID_IDENTIFIER_ERROR, LAST_SURROGATE, LENGTH_LIMIT_ERROR, MAX_CODE_POINT, MAX_PADDED_LENGTH, MAX_REPEATED_BYTES, NEGATIVE_SUBSTRING_ERROR, NFC_FORM, - STRING_FUNCTION_RULE, STRING_FUNCTIONS, UNREAD_UNISTR_ERROR, + PLAIN_IDENTIFIER, QUOTED_KEYWORDS, SCANNER_SPACES, STRING_FUNCTION_RULE, STRING_FUNCTIONS, + UNREAD_IDENTIFIER_ERROR, UNREAD_UNISTR_ERROR, }; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; @@ -284,10 +286,102 @@ fn string_call(name: &str, args: &[Emitted]) -> Result { "VARCHAR", )), }, + ("quote_ident", [x]) if is_text_like(x) => text(quote_ident(x, &s[0])), + ("parse_ident", [x]) if is_text_like(x) => parse_ident(args, x, &s[0]), + ("parse_ident", [x, _]) if is_text_like(x) => Err(refused_function( + name, + "no rule converts parse_ident's strict argument".to_owned(), + )), _ => Err(wrong(name, args)), } } +/// `text` as `quote_ident` shows it: as it is when a plain identifier and no quoted keyword, else in double quotes with each double quote doubled. +fn quoted_identifier(text: &str) -> String { + let plain = text.starts_with(|c: char| c.is_ascii_lowercase() || c == '_') + && text + .chars() + .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_') + && !QUOTED_KEYWORDS.contains(&text); + match plain { + true => text.to_owned(), + false => format!("\"{}\"", text.replace('"', "\"\"")), + } +} + +/// `quote_ident(x)`, folded for a literal. +fn quote_ident(x: &Emitted, sql: &str) -> String { + if let Some(value) = literal_text(x) { + return quoted_text("ed_identifier(value)); + } + let keywords: Vec = QUOTED_KEYWORDS + .iter() + .map(|word| quoted_text(word)) + .collect(); + format!( + "(CASE WHEN regexp_full_match({sql}, '{PLAIN_IDENTIFIER}') AND {sql} NOT IN ({}) \ + THEN {sql} ELSE '\"' || replace({sql}, '\"', '\"\"') || '\"' END)", + keywords.join(", ") + ) +} + +/// The parts of unquoted identifiers joined by dots, ASCII capitals made small; `None` for text that is not one. +fn plain_identifiers(text: &str) -> Option> { + text.split('.').map(plain_identifier).collect() +} + +/// One unquoted identifier with the spaces around it, ASCII capitals made small; `None` when it is none. +fn plain_identifier(part: &str) -> Option { + let word = part.trim_matches(SCANNER_SPACES); + let start = |c: char| c.is_ascii_alphabetic() || c == '_' || !c.is_ascii(); + let valid = word.starts_with(start) + && word + .chars() + .all(|c| start(c) || c.is_ascii_digit() || c == '$'); + valid.then(|| word.to_ascii_lowercase()) +} + +/// `parse_ident(x)` of unquoted identifiers, raising as PostgreSQL does for text that is none; folded for a literal, and a column's double quote raises unread. +fn parse_ident(args: &[Emitted], x: &Emitted, sql: &str) -> Result { + if let Some(value) = literal_text(x) { + if value.contains('"') { + return Err(refused_function( + "parse_ident", + UNREAD_IDENTIFIER_ERROR.to_owned(), + )); + } + let sql = match plain_identifiers(value) { + Some(parts) => { + let parts: Vec = parts.iter().map(|part| quoted_text(part)).collect(); + format!("CAST([{}] AS VARCHAR[])", parts.join(", ")) + } + None => format!( + "CAST(error({}) AS VARCHAR[])", + rejected(INVALID_IDENTIFIER_ERROR) + ), + }; + return Ok(typed(sql, PostgresType::TextArray)); + } + let lower = ascii_case("w", ASCII_UPPER, ASCII_LOWER); + let checks = [ + ( + format!("strpos({sql}, '\"') > 0"), + quoted_text(UNREAD_IDENTIFIER_ERROR), + ), + ( + format!("NOT regexp_full_match({sql}, '{DOTTED_IDENTIFIERS}')"), + rejected(INVALID_IDENTIFIER_ERROR), + ), + ]; + let body = format!( + "list_transform(regexp_extract_all({sql}, '{IDENTIFIER_WORD}'), lambda w: {lower})" + ); + Ok(typed( + guarded(args, &checks, &body, "VARCHAR[]"), + PostgresType::TextArray, + )) +} + /// `initcap(x)`: in each run of ASCII letters and digits the first upper case and the rest lower, every other character kept. fn initcap(x: &str) -> String { let first = ascii_case("left(w, 1)", ASCII_LOWER, ASCII_UPPER); diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/aggregates.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/aggregates.rs index df7b6895b..eee6df920 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/aggregates.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/aggregates.rs @@ -7,14 +7,16 @@ use sqlbabel_diagnostics::refusals::models::Refusal; use crate::postgres::conversion::_helpers::expressions::dispatch::expression; use crate::postgres::conversion::_helpers::expressions::literals::typed; use crate::postgres::conversion::_helpers::expressions::operators::{boolean, json_compared}; -use crate::postgres::conversion::_helpers::expressions::strings::{is_text_like, text_sql}; +use crate::postgres::conversion::_helpers::expressions::strings::text_sql; +use crate::postgres::conversion::_helpers::functions::collected::collected; use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::{ field, flag, list, node_kind, outside_function, refused_function, understood, }; use crate::postgres::conversion::constants::{ - AGGREGATE_RULE, FLOAT_SUM_DIVERGENCE, HYPOTHETICAL_AGGREGATES, MAX_DECIMAL_PRECISION, - ORDERED_SET_AGGREGATES, PLAIN_AGGREGATES, SQUARES_BOUND, STRING_AGG, UNREAD_SQUARES_ERROR, + AGGREGATE_RULE, COLLECTED_AGGREGATES, FLOAT_SUM_DIVERGENCE, HYPOTHETICAL_AGGREGATES, + MAX_DECIMAL_PRECISION, ORDERED_SET_AGGREGATES, PLAIN_AGGREGATES, SQUARES_BOUND, STRING_AGG, + UNREAD_SQUARES_ERROR, }; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; @@ -89,7 +91,7 @@ fn filter( } } -/// An aggregate call: `count`, `sum`, `avg`, `min`, `max`, the boolean and bitwise aggregates, `string_agg` and the pair counts and means. +/// An aggregate call: `count`, `sum`, `avg`, `min`, `max`, the boolean and bitwise aggregates, the pair counts and means, and the aggregates [`collected`] converts. pub(crate) fn aggregate(payload: &Value, site: Site<'_>) -> Result { aggregated(payload, site, "") } @@ -171,7 +173,17 @@ fn aggregated(payload: &Value, site: Site<'_>, over: &str) -> Result>())?; } - if !order.is_empty() && name != STRING_AGG { + if !over.is_empty() && COLLECTED_AGGREGATES.contains(&name.as_str()) { + return Err(refused_function( + &name, + format!("no rule converts {name} over a window"), + )); + } + if let Some(converted) = collected(&name, &args, (order, condition.as_deref(), distinct), inner) + { + return converted; + } + if !order.is_empty() { return Err(refused_function( &name, format!("no rule converts {name} with ORDER BY"), @@ -278,9 +290,6 @@ fn aggregated(payload: &Value, site: Site<'_>, over: &str) -> Result Err(no_such()), }, - ("string_agg", [value, separator]) if is_text_like(value) && is_text_like(separator) => { - string_agg(value, separator, order, (&rows, inner)) - } ("regr_count" | "regr_avgx" | "regr_avgy", [y, x]) if [y, x].iter().all(|value| float_input(value.data_type)) => { @@ -393,56 +402,6 @@ fn sum( })) } -/// `string_agg(value, separator ORDER BY value)`: the order must be the value itself, so rows tied on it hold equal text, and the separator a literal. -fn string_agg( - value: &Emitted, - separator: &Emitted, - order: &[Value], - (rows, site): (&Rows<'_>, Site<'_>), -) -> Result { - let name = "string_agg"; - if !matches!(separator.literal, Some(Literal::Text(_))) { - return Err(refused_function( - name, - "no rule converts string_agg with a separator that is not a string literal".to_owned(), - )); - } - let x = text_sql(value); - let [ordered] = order else { - return Err(refused_function( - name, - "no rule converts string_agg without ORDER BY its value, whose order neither engine fixes" - .to_owned(), - )); - }; - let ordered = understood(ordered, "ordered", &["this", "desc", "nulls_first"])?; - let key = expression(field(ordered, "this"), site)?; - if text_sql(&key) != x { - return Err(refused_function( - name, - "no rule converts string_agg ordered by anything but its value, whose ties neither engine orders" - .to_owned(), - )); - } - let desc = flag(ordered, "desc"); - let direction = match desc { - true => "DESC", - false => "ASC", - }; - let nulls = match field(ordered, "nulls_first").as_bool().unwrap_or(desc) { - true => "FIRST", - false => "LAST", - }; - Ok(typed( - rows.call( - name, - &[x.clone(), separator.sql.clone()], - &format!(" ORDER BY {x} {direction} NULLS {nulls}"), - ), - PostgresType::Text, - )) -} - /// A hypothetical-set aggregate `name(value) WITHIN GROUP (ORDER BY key)`: the rank `value` would take, from the keys before and tied with it. fn hypothetical(name: &str, set: &Hypothetical<'_>) -> Emitted { let (x, v, desc, nulls_first, filter) = diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/calls.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/calls.rs index 1212920fa..0d7ce264b 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/calls.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/calls.rs @@ -1,6 +1,7 @@ //! Function calls: the scalar functions DuckDB computes as PostgreSQL does, and function-style casts. use serde_json::Value; +use sqlbabel_diagnostics::provenance::models::ShapeArgument; use sqlbabel_diagnostics::refusals::models::Refusal; use crate::postgres::conversion::_helpers::expressions::arrays::array_function; @@ -8,6 +9,7 @@ use crate::postgres::conversion::_helpers::expressions::bitstrings::bit_function use crate::postgres::conversion::_helpers::expressions::bytes::bytea_function; use crate::postgres::conversion::_helpers::expressions::datetimes::datetime_function; use crate::postgres::conversion::_helpers::expressions::dispatch::expression; +use crate::postgres::conversion::_helpers::expressions::encodings::encoding_function; use crate::postgres::conversion::_helpers::expressions::fields::field_function; use crate::postgres::conversion::_helpers::expressions::json::json_function; use crate::postgres::conversion::_helpers::expressions::literals::{ @@ -19,16 +21,18 @@ use crate::postgres::conversion::_helpers::expressions::operators::{ use crate::postgres::conversion::_helpers::expressions::patterns::pattern_function; use crate::postgres::conversion::_helpers::expressions::strings::string_function; use crate::postgres::conversion::_helpers::functions::aggregates::aggregate; +use crate::postgres::conversion::_helpers::functions::floats::float_function; use crate::postgres::conversion::_helpers::functions::maths::{ - degrees, factorial, gcd_lcm, radians, rounding, sign, sqrt, + degrees, div, factorial, gcd_lcm, radians, rounding, sign, sqrt, }; use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::{ - field, list, outside_function, refused_function, understood, + field, list, node_kind, outside_function, refused_function, understood, }; use crate::postgres::conversion::constants::{ - AGGREGATE_NAMES, CAST_FUNCTIONS, CAST_RULE, NUMBER_FUNCTION_RULE, SAME_FUNCTION_RULE, - SEQUENCE_RULE, TYPE_OF_RULE, UUID_VARIANT_DIGIT, UUID_VERSION_DIGIT, WINDOW_ONLY_FUNCTIONS, + AGGREGATE_NAMES, ARGUMENT_CONSTRUCT, CAST_FUNCTIONS, CAST_RULE, GREGORIAN_TO_UNIX_MICROS, + NUMBER_FUNCTION_RULE, SAME_FUNCTION_RULE, SEQUENCE_RULE, TYPE_OF_RULE, UUID_VARIANT_DIGIT, + UUID_VERSION_DIGIT, WINDOW_ONLY_FUNCTIONS, }; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; @@ -67,16 +71,54 @@ pub(crate) fn call(payload: &Value, site: Site<'_>) -> Result if let Some(converted) = json_function(&name, list(call, "args"), site) { return converted; } + if let ("num_nulls" | "num_nonnulls", [argument]) = (name.as_str(), list(call, "args")) + && let Some(("variadic", variadic)) = node_kind(argument) + { + let variadic = understood(variadic, "variadic", &["this"])?; + let array = expression(field(variadic, "this"), site)?; + let _rule = site.log.rule(SAME_FUNCTION_RULE); + return variadic_null_count(&name, &array); + } let args: Vec = list(call, "args") .iter() .map(|argument| expression(argument, site)) .collect::>()?; + site.log + .enter(&format!("fn:{}", name.to_ascii_uppercase()), false); + for (index, argument) in args.iter().enumerate() { + site.log.enter(ARGUMENT_CONSTRUCT, false); + site.log + .leave(Some(shape_argument(argument)), (index, Some(index))); + } + let converted = known_function(&name, &args, site); + let argument = match &converted { + Ok(emitted) => Some(shape_argument(emitted)), + Err(_) => None, + }; + site.log + .leave(argument, (std::ptr::from_ref(payload) as usize, None)); + converted +} + +/// A converted argument as a shape records it: its type's name without a length or precision, and whether it is a literal. +fn shape_argument(argument: &Emitted) -> ShapeArgument { + let name = argument.data_type.name(); + ShapeArgument { + family: name.split('(').next().unwrap_or_default().to_owned(), + literal: argument.literal.is_some(), + source: None, + } +} + +/// A scalar function, a function-style cast or `mod` over its converted arguments. +fn known_function(name: &str, args: &[Emitted], site: Site<'_>) -> Result { + let name = name.to_owned(); if let Some((_, target)) = CAST_FUNCTIONS .iter() .find(|(function, _)| *function == name) { let _rule = site.log.rule(CAST_RULE); - return match args.as_slice() { + return match args { [value] => cast_value(value, *target).ok_or_else(|| { outside_function( &name, @@ -98,29 +140,32 @@ pub(crate) fn call(payload: &Value, site: Site<'_>) -> Result bit_function, bytea_function, datetime_function, + encoding_function, field_function, pattern_function, string_function, ] { - if let Some(converted) = function(&name, &args, site) { + if let Some(converted) = function(&name, args, site) { return converted; } } match name.as_str() { "abs" | "@" | "coalesce" | "greatest" | "least" | "nullif" => { - same_function(&name, &args, site) + same_function(&name, args, site) } - "uuid_extract_version" => uuid_version(&args, site), - "pg_typeof" => type_of(&args, site), - "nextval" | "currval" => sequence_value(&name, &args, site), - "mod" => match args.as_slice() { + "uuid_extract_version" => uuid_version(args, site), + "uuid_extract_timestamp" => uuid_timestamp(args, site), + "num_nulls" | "num_nonnulls" => null_count(&name, args, site), + "pg_typeof" => type_of(args, site), + "nextval" | "currval" => sequence_value(&name, args, site), + "mod" => match args { [left, right] => divide("mod", left.clone(), right.clone(), site), _ => Err(refused_function( &name, "mod takes two arguments".to_owned(), )), }, - _ => number_function(&name, &args, site), + _ => number_function(&name, args, site), } } @@ -178,6 +223,9 @@ fn same_function(name: &str, args: &[Emitted], site: Site<'_>) -> Result) -> Result { let _rule = site.log.rule(NUMBER_FUNCTION_RULE); + if let Some(converted) = float_function(name, args) { + return converted; + } let number = |value: &Emitted| { value.data_type.is_exact() || value.data_type.is_float() @@ -185,7 +233,7 @@ fn number_function(name: &str, args: &[Emitted], site: Site<'_>) -> Result Some(double_constant(std::f64::consts::PI)), - ("gcd" | "lcm", [_, _]) if !args.iter().all(number) => { + ("gcd" | "lcm" | "div", [_, _]) if !args.iter().all(number) => { return Err(outside_function( name, format!( @@ -209,6 +257,7 @@ fn number_function(name: &str, args: &[Emitted], site: Site<'_>) -> Result rounding(name, value), ("sign", [value]) => sign(value), ("gcd" | "lcm", [left, right]) => gcd_lcm(name, left, right), + ("div", [left, right]) => div(left, right), ("factorial", [value]) => factorial(value), _ => { return Err(refused_function( @@ -264,6 +313,90 @@ fn uuid_version(args: &[Emitted], site: Site<'_>) -> Result { } } +/// `uuid_extract_timestamp(u)` of a UUID of the RFC 9562 variant: a version 1 UUID's 60-bit clock in units of 100 ns from 1582-10-15, truncated to the microsecond, or a version 7 UUID's 48-bit Unix milliseconds; NULL for any other. +fn uuid_timestamp(args: &[Emitted], site: Site<'_>) -> Result { + let _rule = site.log.rule(SAME_FUNCTION_RULE); + match args { + [value] if value.data_type == PostgresType::Uuid => { + let t = format!("CAST({} AS VARCHAR)", value.sql); + let hex = |parts: &[(usize, usize)]| { + let parts: Vec = parts + .iter() + .map(|(start, length)| format!("substr({t}, {start}, {length})")) + .collect(); + format!("CAST('0x' || {} AS BIGINT)", parts.join(" || ")) + }; + let clock = hex(&[(16, 3), (10, 4), (1, 8)]); + let millis = hex(&[(1, 8), (10, 4)]); + Ok(typed( + format!( + "(CASE WHEN substr({t}, {UUID_VARIANT_DIGIT}, 1) IN ('8', '9', 'a', 'b') THEN CASE substr({t}, {UUID_VERSION_DIGIT}, 1) \ + WHEN '1' THEN timezone('UTC', make_timestamp({clock} // 10 - {GREGORIAN_TO_UNIX_MICROS})) \ + WHEN '7' THEN timezone('UTC', make_timestamp({millis} * 1000)) END END)" + ), + PostgresType::Timestamptz, + )) + } + _ => Err(outside_function( + "uuid_extract_timestamp", + format!( + "PostgreSQL has no uuid_extract_timestamp of {}", + args.iter() + .map(|value| value.data_type.name()) + .collect::>() + .join(", ") + ), + )), + } +} + +/// `num_nulls(...)` and `num_nonnulls(...)` of separate arguments: how many are NULL, or not. +fn null_count(name: &str, args: &[Emitted], site: Site<'_>) -> Result { + let _rule = site.log.rule(SAME_FUNCTION_RULE); + if args.is_empty() { + return Err(outside_function( + name, + format!("PostgreSQL has no {name} of no arguments"), + )); + } + let test = match name { + "num_nulls" => "IS NULL", + _ => "IS NOT NULL", + }; + let counts: Vec = args + .iter() + .map(|value| format!("CAST({} {test} AS INTEGER)", value.sql)) + .collect(); + Ok(typed( + format!("({})", counts.join(" + ")), + PostgresType::Integer, + )) +} + +/// `num_nulls(VARIADIC a)` and `num_nonnulls(VARIADIC a)`: how many of the array's elements are NULL, or not; NULL for a NULL array. +fn variadic_null_count(name: &str, array: &Emitted) -> Result { + if array.data_type.element().is_none() { + return Err(outside_function( + name, + format!( + "PostgreSQL has no {name} of VARIADIC {}", + array.data_type.name() + ), + )); + } + let test = match name { + "num_nulls" => "IS NULL", + _ => "IS NOT NULL", + }; + Ok(typed( + format!( + "CAST(len(list_filter({}, lambda v: v {test})) AS INTEGER)", + array.sql + ), + PostgresType::Integer, + )) +} + /// `nextval('s')` and `currval('s')` of a sequence named by a lower-case literal, which PostgreSQL's `regclass` and DuckDB both read as the sequence `s`; a bigint either way. fn sequence_value(name: &str, args: &[Emitted], site: Site<'_>) -> Result { let _rule = site.log.rule(SEQUENCE_RULE); diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/collected.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/collected.rs new file mode 100644 index 000000000..160002563 --- /dev/null +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/collected.rs @@ -0,0 +1,420 @@ +//! Aggregates whose result follows the order they read rows in: `array_agg`, the JSON aggregates, `any_value` and `string_agg`. A call converts in its own `ORDER BY`, behind a guard that raises where rows tied on every key, or rows of an unordered call, hold different values. + +use serde_json::Value; +use sqlbabel_diagnostics::refusals::models::Refusal; + +use crate::postgres::conversion::_helpers::expressions::bitstrings::rejected; +use crate::postgres::conversion::_helpers::expressions::dispatch::expression; +use crate::postgres::conversion::_helpers::expressions::json::to_json; +use crate::postgres::conversion::_helpers::expressions::literals::{quoted_text, typed}; +use crate::postgres::conversion::_helpers::expressions::strings::{is_text_like, text_sql}; +use crate::postgres::conversion::_helpers::support::scope::Site; +use crate::postgres::conversion::_helpers::support::tree::{ + field, flag, outside_function, refused_function, understood, +}; +use crate::postgres::conversion::constants::{ + AGGREGATE_ORDER_DIVERGENCE, AGGREGATE_ORDER_ERROR, COLLECTED_AGGREGATES, DUPLICATE_KEY_ERROR, + NULL_KEY_ERROR, +}; +use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; + +/// A collected call's rows: its `ORDER BY` written out, the keys' SQL, and its `FILTER` condition. +struct Order<'a> { + clause: String, + keys: Vec, + filter: Option<&'a str>, +} + +impl Order<'_> { + /// The rows' condition with `extra`, as a `FILTER` clause; empty when there is none. + fn rows(&self, extra: Option<&str>) -> String { + let conditions: Vec<&str> = self.filter.into_iter().chain(extra).collect(); + match conditions.is_empty() { + true => String::new(), + false => format!(" FILTER (WHERE {})", conditions.join(" AND ")), + } + } + + /// The test that rows the order leaves tied hold different `values`, among those passing `extra`; `None` when the order is the one value itself. + fn ties(&self, values: &[(&str, &str)], extra: Option<&str>) -> Option { + if let [(_, value)] = values + && self.keys.iter().map(String::as_str).eq([*value]) + { + return None; + } + let keys: Vec = self + .keys + .iter() + .enumerate() + .map(|(index, key)| format!("'k{}': {key}", index + 1)) + .collect(); + let held: Vec = keys + .iter() + .cloned() + .chain(values.iter().map(|(name, sql)| format!("'{name}': {sql}"))) + .collect(); + let rows = self.rows(extra); + let tied = match keys.is_empty() { + true => "1".to_owned(), + false => format!("count(DISTINCT {{{}}}){rows}", keys.join(", ")), + }; + Some(format!( + "count(DISTINCT {{{}}}){rows} > {tied}", + held.join(", ") + )) + } +} + +/// Whether DuckDB orders and tells apart values of `data_type` as PostgreSQL does, so a key or a guarded value of it reads rows alike. +fn comparable(data_type: PostgresType) -> bool { + use PostgresType as T; + data_type.is_exact() + || is_text_like(&typed(String::new(), data_type)) + || matches!( + data_type, + T::Boolean | T::Date | T::Timestamp | T::Uuid | T::Null + ) +} + +/// The call's `ORDER BY` keys, each ascending with NULLs last unless written otherwise, as PostgreSQL sorts. +fn order<'a>( + name: &str, + written: &[Value], + filter: Option<&'a str>, + site: Site<'_>, +) -> Result, Refusal> { + let mut clause: Vec = Vec::new(); + let mut keys: Vec = Vec::new(); + for ordered in written { + let ordered = understood(ordered, "ordered", &["this", "desc", "nulls_first"])?; + let key = expression(field(ordered, "this"), site)?; + if !comparable(key.data_type) { + return Err(refused_function( + name, + format!( + "no rule orders {name} by {}, which DuckDB may sort or tell apart otherwise", + key.data_type.name() + ), + )); + } + let desc = flag(ordered, "desc"); + let nulls = field(ordered, "nulls_first").as_bool().unwrap_or(desc); + let sql = text_sql(&key); + clause.push(format!( + "{sql} {} NULLS {}", + if desc { "DESC" } else { "ASC" }, + if nulls { "FIRST" } else { "LAST" } + )); + keys.push(sql); + } + Ok(Order { + clause: match clause.is_empty() { + true => String::new(), + false => format!(" ORDER BY {}", clause.join(", ")), + }, + keys, + filter, + }) +} + +/// `body` behind `checks`, each a test and its quoted message, as one CASE of type `duckdb_type`. +fn behind(checks: &[(String, String)], body: &str, duckdb_type: &str) -> String { + if checks.is_empty() { + return body.to_owned(); + } + let raises: String = checks + .iter() + .map(|(test, message)| format!("WHEN {test} THEN CAST(error({message}) AS {duckdb_type}) ")) + .collect(); + format!("(CASE {raises}ELSE {body} END)") +} + +/// The row-order guard of `ties`, logged as the divergence it raises. +fn order_check(name: &str, ties: Option, site: Site<'_>) -> Vec<(String, String)> { + let Some(ties) = ties else { + return Vec::new(); + }; + site.log.divergence( + AGGREGATE_ORDER_DIVERGENCE, + &format!("fn:{}", name.to_ascii_uppercase()), + ); + vec![( + ties, + quoted_text(&format!( + "{AGGREGATE_ORDER_DIVERGENCE}: {AGGREGATE_ORDER_ERROR}" + )), + )] +} + +/// `value` as text JSON writes, or the refusal of a type no rule writes as PostgreSQL does. +fn json_value(name: &str, value: &Emitted, target: PostgresType) -> Result { + to_json(value, target).ok_or_else(|| { + refused_function( + name, + format!( + "no rule writes {} as {name} writes it", + value.data_type.name() + ), + ) + }) +} + +/// A collected aggregate's call; `None` for another aggregate. +pub(crate) fn collected( + name: &str, + args: &[Emitted], + (written, filter, distinct): (&[Value], Option<&str>, bool), + site: Site<'_>, +) -> Option> { + if !COLLECTED_AGGREGATES.contains(&name) { + return None; + } + Some( + order(name, written, filter, site).and_then(|order| match distinct { + false => collect(name, args, &order, site), + true => distinct_string_agg(name, args, &order), + }), + ) +} + +/// `string_agg(DISTINCT)` with a literal separator, ordered by its value alone, so its order has no ties; every other DISTINCT call is refused. +fn distinct_string_agg( + name: &str, + args: &[Emitted], + order: &Order<'_>, +) -> Result { + if let ("string_agg", [value, separator]) = (name, args) + && is_text_like(value) + && matches!(separator.literal, Some(Literal::Text(_))) + { + let x = text_sql(value); + if order.ties(&[("v", &x)], None).is_none() { + let body = format!( + "string_agg(DISTINCT {x}, {}{}){}", + text_sql(separator), + order.clause, + order.rows(None) + ); + return Ok(typed(body, PostgresType::Text)); + } + } + Err(refused_function( + name, + format!( + "no rule converts {name} with DISTINCT but string_agg with a literal separator ordered by its value alone" + ), + )) +} + +/// One collected aggregate over its converted arguments. +fn collect( + name: &str, + args: &[Emitted], + order: &Order<'_>, + site: Site<'_>, +) -> Result { + use PostgresType as T; + let strict = name.ends_with("_strict"); + if let [value] = args + && matches!( + name, + "array_agg" + | "any_value" + | "json_agg" + | "json_agg_strict" + | "jsonb_agg" + | "jsonb_agg_strict" + ) + { + if value.data_type == T::Null || matches!(value.literal, Some(Literal::Text(_))) { + return Err(refused_function( + name, + format!( + "no rule converts {name} of an untyped literal, whose type PostgreSQL cannot resolve" + ), + )); + } + if matches!(value.data_type, T::Bpchar { .. }) && !name.starts_with("json") { + return Err(refused_function( + name, + format!("no rule keeps the padding of a character(n) value in {name}"), + )); + } + } + match (name, args) { + ("array_agg", [value]) => { + let result = match value.data_type { + T::Integer => T::IntegerArray, + data_type if is_text_like(&typed(String::new(), data_type)) => T::TextArray, + _ => return Err(wrong(name, args)), + }; + let x = text_sql(value); + let checks = order_check(name, order.ties(&[("v", &x)], None), site); + let body = format!("list({x}{}){}", order.clause, order.rows(None)); + Ok(typed(behind(&checks, &body, &result.duckdb_name()), result)) + } + ("any_value", [value]) if order.keys.is_empty() && comparable(value.data_type) => { + let x = text_sql(value); + let not_null = format!("{x} IS NOT NULL"); + let checks = order_check(name, order.ties(&[("v", &x)], Some(¬_null)), site); + let body = format!("any_value({x}){}", order.rows(None)); + let result = match value.data_type { + T::Bpchar { .. } => T::Text, + data_type => data_type, + }; + Ok(typed(behind(&checks, &body, &result.duckdb_name()), result)) + } + ("string_agg", [value, separator]) if is_text_like(value) && is_text_like(separator) => { + let (x, s) = (text_sql(value), text_sql(separator)); + let not_null = format!("{x} IS NOT NULL"); + let literal = matches!(separator.literal, Some(Literal::Text(_))); + let values: Vec<(&str, &str)> = match literal { + true => vec![("v", &x)], + false => vec![("v", &x), ("s", &s)], + }; + let checks = order_check(name, order.ties(&values, Some(¬_null)), site); + let body = match literal { + true => format!("string_agg({x}, {s}{}){}", order.clause, order.rows(None)), + false => format!( + "array_to_string(list_transform(list({{'v': {x}, 's': {s}}}{}){}, \ + lambda e, i: CASE WHEN i = 1 THEN e['v'] ELSE coalesce(e['s'], '') || e['v'] END), '')", + order.clause, + order.rows(Some(¬_null)) + ), + }; + Ok(typed(behind(&checks, &body, "VARCHAR"), T::Text)) + } + ("json_agg" | "json_agg_strict" | "jsonb_agg" | "jsonb_agg_strict", [value]) => { + let jsonb = name.starts_with("jsonb"); + let target = if jsonb { T::Jsonb } else { T::Json }; + let element = json_value(name, value, target)?; + let x = text_sql(value); + let not_null = format!("{x} IS NOT NULL"); + let kept = strict.then_some(not_null.as_str()); + let checks = order_check(name, order.ties(&[("v", &x)], kept), site); + let rows = order.rows(kept); + let listed = match jsonb { + true => format!("to_json(list({}{}){rows})", element.sql, order.clause), + false => format!( + "'[' || array_to_string(list(coalesce(CAST({} AS VARCHAR), 'null'){}){rows}, ', ') || ']'", + element.sql, order.clause + ), + }; + let body = match (strict, jsonb) { + (false, _) => listed, + (true, true) => format!( + "CASE WHEN count(*){} > 0 THEN coalesce({listed}, CAST('[]' AS JSON)) END", + order.rows(None) + ), + (true, false) => format!( + "CASE WHEN count(*){} > 0 THEN coalesce({listed}, '[]') END", + order.rows(None) + ), + }; + let result = if jsonb { T::Jsonb } else { T::JsonText }; + Ok(typed(behind(&checks, &body, &result.duckdb_name()), result)) + } + (_, [key, value]) if name.contains("object_agg") => { + object_agg(name, (key, value), order, site) + } + _ => Err(wrong(name, args)), + } +} + +/// The refusal of `name` over arguments of these types. +fn wrong(name: &str, args: &[Emitted]) -> Refusal { + outside_function( + name, + format!( + "no rule converts {name} of {}", + args.iter() + .map(|value| value.data_type.name()) + .collect::>() + .join(", ") + ), + ) +} + +/// `json_object_agg` or `jsonb_object_agg`, strict, unique or both: raising for a NULL key and, when unique, a repeated one; `json` writes the pairs in row order, `jsonb` keeps one per key in its key order. +fn object_agg( + name: &str, + (key, value): (&Emitted, &Emitted), + order: &Order<'_>, + site: Site<'_>, +) -> Result { + use PostgresType as T; + if !(key.data_type.is_integral() || is_text_like(key)) { + return Err(wrong(name, &[key.clone(), value.clone()])); + } + if matches!(key.data_type, T::Bpchar { .. }) { + return Err(refused_function( + name, + format!("no rule keeps the padding of a character(n) key in {name}"), + )); + } + let jsonb = name.starts_with("jsonb"); + let (strict, unique) = (name.ends_with("_strict"), name.contains("_unique")); + let k = format!("CAST({} AS VARCHAR)", text_sql(key)); + let key_json = json_value(name, &typed(k.clone(), T::Text), T::Json)?; + let target = if jsonb { T::Jsonb } else { T::Json }; + let v = json_value(name, value, target)?; + let v_text = format!("CAST({} AS VARCHAR)", v.sql); + let not_null = format!("{} IS NOT NULL", value.sql); + let kept = strict.then_some(not_null.as_str()); + let all = order.rows(None); + let mut checks: Vec<(String, String)> = vec![( + format!("count(*){all} > count({k}){all}"), + rejected(NULL_KEY_ERROR), + )]; + if unique { + checks.push(( + format!("count({k}){all} > count(DISTINCT {k}){all}"), + rejected(DUPLICATE_KEY_ERROR), + )); + } + let rows = order.rows(kept); + let (body, result) = match jsonb { + true => { + let per_key = Order { + clause: String::new(), + keys: vec![k.clone()], + filter: order.filter, + }; + checks.extend(order_check( + name, + per_key.ties(&[("k", &k), ("v", &v_text)], kept), + site, + )); + let entries = format!( + "list_sort(list(DISTINCT {{'n': strlen({k}), 'key': {k}, 'value': coalesce({}, CAST('null' AS JSON))}}){rows})", + v.sql + ); + ( + format!( + "CASE WHEN count(*){all} > 0 THEN coalesce(to_json(map_from_entries(list_transform({entries}, \ + lambda e: {{'key': e['key'], 'value': e['value']}}))), CAST('{{}}' AS JSON)) END" + ), + T::Jsonb, + ) + } + false => { + checks.extend(order_check( + name, + order.ties(&[("k", &k), ("v", &v_text)], kept), + site, + )); + let pair = format!( + "CAST({} AS VARCHAR) || ' : ' || coalesce({v_text}, 'null')", + key_json.sql + ); + ( + format!( + "CASE WHEN count(*){all} > 0 THEN '{{ ' || coalesce(array_to_string(list({pair}{}){rows}, ', '), '') || ' }}' END", + order.clause + ), + T::JsonText, + ) + } + }; + Ok(typed(behind(&checks, &body, &result.duckdb_name()), result)) +} diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/floats.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/floats.rs new file mode 100644 index 000000000..fa94e160a --- /dev/null +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/floats.rs @@ -0,0 +1,473 @@ +//! The `float8` functions PostgreSQL computes with one C library call, and its degree-based trigonometry, their checks written out and folded for a constant. + +use sqlbabel_diagnostics::failures::constants::ARGUMENT_REJECTED; +use sqlbabel_diagnostics::refusals::models::Refusal; + +use crate::postgres::conversion::_helpers::expressions::literals::{double_constant, typed}; +use crate::postgres::conversion::_helpers::expressions::operators::{check_conditions, guarded}; +use crate::postgres::conversion::_helpers::functions::maths::as_double; +use crate::postgres::conversion::_helpers::support::tree::{outside_function, refused_function}; +use crate::postgres::conversion::constants::{ + ACOS_HALF_BITS, ARC_COSINE_DEGREES_FUNCTION, ARCSINE_SWITCH, ASIN_HALF_BITS, ATAN_ONE_BITS, + COMPLEX_POWER_ERROR, COSINE_SWITCH_DEGREES, DOUBLE_ZERO, FLOAT_FUNCTIONS, FLOAT_OVERFLOW_ERROR, + FLOAT_UNDERFLOW_ERROR, HALF_TURN, INPUT_RANGE_ERROR, LOG_NEGATIVE_ERROR, LOG_ZERO_ERROR, + MAX_UNCHECKED_EXP, MAX_UNCHECKED_GAMMA, NATURAL_LOG_FUNCTION, NUMERIC_OVERLOADS, + ONE_MINUS_COS_60_BITS, QUARTER_TURN, RADIANS_PER_DEGREE_BITS, SIN_30_BITS, SINE_SWITCH_DEGREES, + THREE_QUARTER_TURN, UNIT_BOUND, ZERO_POWER_ERROR, +}; +use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; + +/// A check: its conditions, `None` when it never fires, and the error it raises. +type Check = (Option>, String); + +/// A function of [`FLOAT_FUNCTIONS`] over its converted arguments; `None` for another name. +pub(crate) fn float_function(name: &str, args: &[Emitted]) -> Option> { + if !FLOAT_FUNCTIONS.contains(&name) { + return None; + } + let types = args + .iter() + .map(|value| value.data_type.name()) + .collect::>() + .join(", "); + let number = |value: &Emitted| { + value.data_type.is_exact() + || value.data_type.is_float() + || value.data_type == PostgresType::Null + }; + if !args.iter().all(number) { + return Some(Err(outside_function( + name, + format!("PostgreSQL has no {name} of {types}"), + ))); + } + let numeric = args.iter().any(|value| value.data_type.is_numeric()) + && !args.iter().any(|value| value.data_type.is_float()); + if numeric && NUMERIC_OVERLOADS.contains(&name) { + return Some(Err(refused_function( + name, + format!( + "PostgreSQL computes {name} of numeric in its own decimal arithmetic, to more digits than DuckDB's DOUBLE holds" + ), + ))); + } + if matches!(name, "erf" | "erfc") { + return Some(Err(refused_function(name, format!("DuckDB has no {name}")))); + } + let constants: Vec> = args.iter().map(constant).collect(); + let converted = match ( + args.iter().map(as_double).collect::>>(), + constants.as_slice(), + ) { + (Some(doubles), [c]) => one_argument(name, &doubles[0], *c), + (Some(doubles), [a, b]) => two_arguments(name, (&doubles[0], &doubles[1]), (*a, *b)), + _ => None, + }; + Some( + converted + .ok_or_else(|| refused_function(name, format!("no rule converts {name} of {types}"))), + ) +} + +/// A constant argument's value as `float8` reads it: a folded float, or digits read correctly rounded as PostgreSQL's cast reads them. +fn constant(value: &Emitted) -> Option { + match &value.literal { + Some(Literal::Float(bits)) => Some(f64::from_bits(*bits)), + Some(Literal::Number(text)) => match text.parse::() { + Ok(parsed) if parsed.is_finite() => Some(parsed), + Ok(_) | Err(_) => None, + }, + _ => None, + } +} + +/// A part of a check's conditions: always or never for a constant, by `holds`, else `sql`. +fn part(constant: Option, holds: impl Fn(f64) -> bool, sql: String) -> Option { + match constant { + Some(value) if holds(value) => Some(String::new()), + Some(_) => None, + None => Some(sql), + } +} + +/// An error message after the rejected-argument fragment, which DuckDB's kinds read as PostgreSQL's invalid-argument SQLSTATEs. +fn rejected(message: &str) -> String { + format!("{ARGUMENT_REJECTED}: {message}") +} + +/// `result` behind `checks`, a DOUBLE. +fn checked(checks: Vec, result: String) -> Emitted { + guarded( + checks + .iter() + .map(|(conditions, error)| (conditions.clone(), error.as_str())) + .collect(), + result, + PostgresType::Double, + ) +} + +/// A one-argument function: the C library call DuckDB makes too, behind the checks PostgreSQL makes before or after it. +fn one_argument(name: &str, x: &Emitted, c: Option) -> Option { + let sql = &x.sql; + let infinite = || part(c, f64::is_infinite, format!("isinf({sql})")); + let finite = || part(c, f64::is_finite, format!("isfinite({sql})")); + let unit = || { + part( + c, + |value| value.abs() > UNIT_BOUND, + format!("abs({sql}) > 1 AND NOT isnan({sql})"), + ) + }; + let range = |conditions: Option| { + vec![( + check_conditions(vec![conditions]), + INPUT_RANGE_ERROR.to_owned(), + )] + }; + let call = |function: &str| format!("{function}({sql})"); + let unchecked = |lowest: f64, highest: f64| { + c.is_some_and(|value| value.is_nan() || (lowest..=highest).contains(&value)) + }; + let emitted = match name { + "sin" | "cos" | "tan" | "cot" => checked(range(infinite()), call(name)), + "asin" | "acos" | "atanh" => checked(range(unit()), call(name)), + "acosh" => checked( + range(part(c, |value| value < UNIT_BOUND, format!("{sql} < 1"))), + call(name), + ), + "atan" | "sinh" | "cosh" | "tanh" | "asinh" | "cbrt" => { + typed(call(name), PostgresType::Double) + } + "||/" => typed(call("cbrt"), PostgresType::Double), + "ln" | "log" | "log10" => checked( + vec![ + ( + check_conditions(vec![part( + c, + |value| value == DOUBLE_ZERO, + format!("{sql} = 0"), + )]), + rejected(LOG_ZERO_ERROR), + ), + ( + check_conditions(vec![part( + c, + |value| value < DOUBLE_ZERO, + format!("{sql} < 0"), + )]), + rejected(LOG_NEGATIVE_ERROR), + ), + ], + call(match name { + NATURAL_LOG_FUNCTION => NATURAL_LOG_FUNCTION, + _ => "log10", + }), + ), + "exp" if unchecked(-MAX_UNCHECKED_EXP, MAX_UNCHECKED_EXP) => { + typed(call(name), PostgresType::Double) + } + "exp" => { + let result = call(name); + checked( + vec![ + ( + check_conditions(vec![Some(format!("isinf({result})")), finite()]), + FLOAT_OVERFLOW_ERROR.to_owned(), + ), + ( + check_conditions(vec![Some(format!("{result} = 0")), finite()]), + FLOAT_UNDERFLOW_ERROR.to_owned(), + ), + ], + result, + ) + } + "gamma" | "lgamma" if unchecked(f64::MIN_POSITIVE, MAX_UNCHECKED_GAMMA) => { + typed(call(name), PostgresType::Double) + } + "gamma" => { + let result = call(name); + checked( + vec![ + ( + check_conditions(vec![ + Some(format!("NOT isfinite({result})")), + part( + c, + |value| value < f64::INFINITY, + format!("{sql} < CAST('Infinity' AS DOUBLE)"), + ), + ]), + FLOAT_OVERFLOW_ERROR.to_owned(), + ), + ( + check_conditions(vec![Some(format!("{result} = 0"))]), + FLOAT_UNDERFLOW_ERROR.to_owned(), + ), + ], + result, + ) + } + "lgamma" => { + let result = call(name); + checked( + vec![( + check_conditions(vec![Some(format!("isinf({result})")), finite()]), + FLOAT_OVERFLOW_ERROR.to_owned(), + )], + result, + ) + } + "sind" | "cosd" | "tand" | "cotd" => reduced_degrees(name, x, c), + "asind" | "acosd" => inverse_degrees(name, x, c), + "atand" => typed( + format!("atan({sql}) / {} * 45", bits_constant(ATAN_ONE_BITS)), + PostgresType::Double, + ), + _ => return None, + }; + Some(emitted) +} + +/// A two-argument function: `atan2`, `atan2d` or `power`, the latter behind PostgreSQL's checks. +fn two_arguments( + name: &str, + (x, y): (&Emitted, &Emitted), + (cx, cy): (Option, Option), +) -> Option { + let (a, b) = (&x.sql, &y.sql); + let emitted = match name { + "atan2" => typed(format!("atan2({a}, {b})"), PostgresType::Double), + "atan2d" => typed( + format!("atan2({a}, {b}) / {} * 45", bits_constant(ATAN_ONE_BITS)), + PostgresType::Double, + ), + "power" | "pow" => { + let result = format!("pow({a}, {b})"); + let finite_x = || part(cx, f64::is_finite, format!("isfinite({a})")); + let finite_y = || part(cy, f64::is_finite, format!("isfinite({b})")); + checked( + vec![ + ( + check_conditions(vec![ + part(cx, |value| value == DOUBLE_ZERO, format!("{a} = 0")), + part(cy, |value| value < DOUBLE_ZERO, format!("{b} < 0")), + ]), + rejected(ZERO_POWER_ERROR), + ), + ( + check_conditions(vec![ + part(cx, |value| value < DOUBLE_ZERO, format!("{a} < 0")), + part( + cy, + |value| !value.is_nan() && value != value.floor(), + format!("{b} <> floor({b})"), + ), + ]), + rejected(COMPLEX_POWER_ERROR), + ), + ( + check_conditions(vec![ + Some(format!("isinf({result})")), + finite_x(), + finite_y(), + ]), + FLOAT_OVERFLOW_ERROR.to_owned(), + ), + ( + check_conditions(vec![ + Some(format!("{result} = 0")), + part(cx, |value| value != 0.0, format!("{a} <> 0")), + finite_x(), + finite_y(), + ]), + FLOAT_UNDERFLOW_ERROR.to_owned(), + ), + ], + result, + ) + } + _ => return None, + }; + Some(emitted) +} + +/// The DOUBLE constant with these bits, as SQL. +fn bits_constant(bits: u64) -> String { + double_constant(f64::from_bits(bits)).sql +} + +/// PostgreSQL's `sind_q1(a)` of an angle from 0 to 90: `sin` scaled to give exactly 0.5 at 30, or `1 - cos` of the complement scaled to give exactly 0.5 at 60; the branch chosen now for a known angle. +fn sine_quadrant(a: &str, known: Option) -> String { + let (low, high) = (sine_to_30(a), cosine_to_60(&format!("(90 - {a})"))); + match known { + Some(angle) if angle <= SINE_SWITCH_DEGREES => low, + Some(_) => high, + None => format!("CASE WHEN {a} <= 30 THEN {low} ELSE {high} END"), + } +} + +/// PostgreSQL's `cosd_q1(a)`, as [`sine_quadrant`]. +fn cosine_quadrant(a: &str, known: Option) -> String { + let (low, high) = (cosine_to_60(a), sine_to_30(&format!("(90 - {a})"))); + match known { + Some(angle) if angle <= COSINE_SWITCH_DEGREES => low, + Some(_) => high, + None => format!("CASE WHEN {a} <= 60 THEN {low} ELSE {high} END"), + } +} + +/// PostgreSQL's `sind_0_to_30(x)`. +fn sine_to_30(x: &str) -> String { + let radians = RADIANS_PER_DEGREE_BITS; + format!( + "sin({x} * {}) / {} / 2", + bits_constant(radians), + bits_constant(SIN_30_BITS) + ) +} + +/// PostgreSQL's `cosd_0_to_60(x)`. +fn cosine_to_60(x: &str) -> String { + let radians = RADIANS_PER_DEGREE_BITS; + format!( + "1 - (1 - cos({x} * {})) / {} / 2", + bits_constant(radians), + bits_constant(ONE_MINUS_COS_60_BITS) + ) +} + +/// `sind`, `cosd`, `tand` or `cotd` as PostgreSQL computes it: the angle reduced into 0 to 90 by exact steps with a sign, then the quadrant function; reduced now for a constant. +fn reduced_degrees(name: &str, x: &Emitted, c: Option) -> Emitted { + let body = |a: &str, known: Option| match name { + "sind" => sine_quadrant(a, known), + "cosd" => cosine_quadrant(a, known), + "tand" => format!( + "({}) / ({})", + sine_quadrant(a, known), + cosine_quadrant(a, known) + ), + _ => format!( + "({}) / ({})", + cosine_quadrant(a, known), + sine_quadrant(a, known) + ), + }; + let zeroed = |sql: String| match name { + "tand" | "cotd" => format!("{sql} + 0"), + _ => sql, + }; + let result = match c { + Some(value) if value.is_nan() => return double_constant(value), + Some(value) if value.is_finite() => { + let r = value % 360.0; + let a = r.abs(); + let angle = match a { + a if a > THREE_QUARTER_TURN => 360.0 - a, + a if a > HALF_TURN => a - HALF_TURN, + a if a > QUARTER_TURN => HALF_TURN - a, + a => a, + }; + let negative = match name { + "sind" => r.is_sign_negative() != (a > HALF_TURN), + "cosd" => a > QUARTER_TURN && a < THREE_QUARTER_TURN, + _ => { + r.is_sign_negative() + != ((a > QUARTER_TURN && a <= HALF_TURN) || a >= THREE_QUARTER_TURN) + } + }; + let quadrant = body(&double_constant(angle).sql, Some(angle)); + zeroed(match negative { + true => format!("-({quadrant})"), + false => quadrant, + }) + } + _ => { + let negative = match name { + "sind" => "signbit(r) <> (abs(r) > 180)", + "cosd" => "abs(r) > 90 AND abs(r) < 270", + _ => "signbit(r) <> (abs(r) > 90 AND abs(r) <= 180 OR abs(r) >= 270)", + }; + zeroed(format!( + "list_apply([{} % 360], lambda r: CASE WHEN {negative} THEN -1 ELSE 1 END * \ + list_apply([CASE WHEN abs(r) > 270 THEN 360 - abs(r) WHEN abs(r) > 180 THEN abs(r) - 180 \ + WHEN abs(r) > 90 THEN 180 - abs(r) ELSE abs(r) END], lambda a: {})[1])[1]", + x.sql, + body("a", None) + )) + } + }; + let infinite = part(c, f64::is_infinite, format!("isinf({})", x.sql)); + checked( + vec![( + check_conditions(vec![infinite]), + INPUT_RANGE_ERROR.to_owned(), + )], + result, + ) +} + +/// PostgreSQL's `asind_q1(x)` of a value from 0 to 1: `asin` scaled to give exactly 30 at 0.5, or 90 less `acos` scaled to give exactly 60 there; `acosd_q1(x)`, its complement, when `complement`. +fn arcsine_quadrant(v: &str, known: Option, complement: bool) -> String { + let (half, whole) = (bits_constant(ASIN_HALF_BITS), bits_constant(ACOS_HALF_BITS)); + let (low, high) = match complement { + false => ( + format!("asin({v}) / {half} * 30"), + format!("90 - acos({v}) / {whole} * 60"), + ), + true => ( + format!("90 - asin({v}) / {half} * 30"), + format!("acos({v}) / {whole} * 60"), + ), + }; + match known { + Some(value) if value <= ARCSINE_SWITCH => low, + Some(_) => high, + None => format!("CASE WHEN {v} <= 0.5 THEN {low} ELSE {high} END"), + } +} + +/// `asind` or `acosd` as PostgreSQL computes it: raising outside -1 to 1, a negative value through its positive; the branch chosen now for a constant. +fn inverse_degrees(name: &str, x: &Emitted, c: Option) -> Emitted { + let complement = name == ARC_COSINE_DEGREES_FUNCTION; + let branches = |v: &str, negated: &str, known: Option| { + let positive = arcsine_quadrant(v, known, complement); + let negative = arcsine_quadrant(negated, known.map(|value| -value), false); + let negative = match complement { + true => format!("90 + ({negative})"), + false => format!("-({negative})"), + }; + match known { + Some(value) if value >= DOUBLE_ZERO => positive, + Some(_) => negative, + None => format!("CASE WHEN {v} >= 0 THEN {positive} ELSE {negative} END"), + } + }; + let result = match c { + Some(value) if value.is_nan() => return double_constant(value), + Some(value) if value.abs() <= UNIT_BOUND => branches( + &double_constant(value).sql, + &double_constant(-value).sql, + Some(value), + ), + Some(_) => String::new(), + None => format!( + "list_apply([{}], lambda v: {})[1]", + x.sql, + branches("v", "(-v)", None) + ), + }; + let outside = part( + c, + |value| value.abs() > UNIT_BOUND, + format!("abs({sql}) > 1 AND NOT isnan({sql})", sql = x.sql), + ); + checked( + vec![( + check_conditions(vec![outside]), + INPUT_RANGE_ERROR.to_owned(), + )], + result, + ) +} diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/maths.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/maths.rs index 505bb8e24..a40699d7e 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/maths.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/maths.rs @@ -128,7 +128,7 @@ pub(crate) fn sign(value: &Emitted) -> Option { } /// `value` as a DOUBLE, as PostgreSQL's `float8` functions read their argument; `None` for a value no rule converts. -fn as_double(value: &Emitted) -> Option { +pub(crate) fn as_double(value: &Emitted) -> Option { match value.data_type { PostgresType::Double => Some(value.clone()), PostgresType::Null => Some(typed( @@ -207,6 +207,54 @@ pub(crate) fn gcd_lcm(name: &str, left: &Emitted, right: &Emitted) -> Option Option { + let resolved = |value: &Emitted, other: &Emitted| match value.data_type { + PostgresType::Null => other.data_type, + data_type => data_type, + }; + let (a_type, b_type) = (resolved(left, right), resolved(right, left)); + let ((a_precision, a_scale), (b_precision, b_scale)) = + (as_numeric(a_type)?, as_numeric(b_type)?); + let scale = a_scale.max(b_scale); + let precision = (a_precision - a_scale + scale).max(1); + if precision > MAX_DECIMAL_PRECISION + || !product_fits(a_type, a_precision, scale) + || !product_fits(b_type, b_precision, scale) + { + return None; + } + let factor = format!("1{}", "0".repeat(usize::from(scale))); + let folded = |value: &Emitted| match &value.literal { + Some(Literal::Number(text)) => unscaled(&Decimal::parse(text)?, usize::from(scale)), + _ => None, + }; + let scaled = |value: &Emitted| match value.data_type { + _ if let Some(whole) = folded(value) => whole.to_string(), + PostgresType::Null => "CAST(NULL AS HUGEINT)".to_owned(), + PostgresType::Numeric { scale: own, .. } if own > 0 => format!( + "CAST(CAST({} AS DECIMAL({MAX_DECIMAL_PRECISION}, {own})) * {factor} AS HUGEINT)", + value.sql + ), + _ if scale == 0 => format!("CAST({} AS HUGEINT)", value.sql), + _ => format!("(CAST({} AS HUGEINT) * {factor})", value.sql), + }; + let data_type = PostgresType::Numeric { + precision, + scale: 0, + declared: false, + }; + Some(typed( + format!( + "CAST(({} // {}) AS {})", + scaled(left), + scaled(right), + data_type.duckdb_name() + ), + data_type, + )) +} + /// The digits a `gcd` has at most, those of the wider argument, or an `lcm`, those of both. fn result_digits(name: &str, a_digits: u8, b_digits: u8) -> u8 { match name { diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/mod.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/mod.rs index 35f602619..206716c84 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/mod.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/functions/mod.rs @@ -1,3 +1,5 @@ pub(crate) mod aggregates; pub(crate) mod calls; +pub(crate) mod collected; +pub(crate) mod floats; pub(crate) mod maths; diff --git a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/queries/sets.rs b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/queries/sets.rs index a484726ce..0026d10c1 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/_helpers/queries/sets.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/_helpers/queries/sets.rs @@ -7,12 +7,14 @@ use crate::postgres::conversion::_helpers::expressions::dispatch::expression; use crate::postgres::conversion::_helpers::expressions::json::json_set; use crate::postgres::conversion::_helpers::expressions::literals::typed; use crate::postgres::conversion::_helpers::expressions::operators::coerced; +use crate::postgres::conversion::_helpers::expressions::patterns::split_list; use crate::postgres::conversion::_helpers::support::scope::Site; use crate::postgres::conversion::_helpers::support::tree::{ field, list, node_kind, outside_function, quoted, refused, understood, }; use crate::postgres::conversion::constants::{ - JSON_RULE, ONE_DIGITS, SET_ELEMENT, SET_FUNCTIONS, SET_POSITION, SET_RELATION, SET_RULE, + JSON_RULE, ONE_DIGITS, PATTERN_RULE, SET_ELEMENT, SET_FUNCTIONS, SET_POSITION, SET_RELATION, + SET_RULE, SPLIT_SETS, }; use crate::postgres::conversion::models::{Emitted, Literal, PostgresType}; @@ -62,6 +64,18 @@ fn source(name: &str, call: &Value, site: Site<'_>) -> Result<(String, Emitted), ), ) }; + if let Some((_, list)) = SPLIT_SETS.iter().find(|(set, _)| *set == name) { + let _rule = site.log.rule(PATTERN_RULE); + let list = split_list(name, list, &args)?; + let (rows, element_type) = match name { + "regexp_matches" => ( + format!("list_filter([{}], lambda m: m IS NOT NULL)", list.sql), + T::TextArray, + ), + _ => (list.sql, T::Text), + }; + return Ok((format!("unnest({rows})"), typed(element, element_type))); + } if let Some(set) = json_set(name, &args, &element) { let _rule = site.log.rule(JSON_RULE); return set; diff --git a/crates/sqlbabel-convert/src/postgres/conversion/constants.rs b/crates/sqlbabel-convert/src/postgres/conversion/constants.rs index e59f6a351..6218bb5a7 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/constants.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/constants.rs @@ -108,6 +108,33 @@ pub const WINDOW_ONLY_FUNCTIONS: &[&str] = &[ pub const WINDOW_RULE: &str = "rule.postgres.window"; /// The divergence a window call reading rows in order relies on: rows tied on every key come in an order neither engine fixes. pub const ROW_ORDER_DIVERGENCE: &str = "window_row_order"; +/// The divergence of an aggregate whose result follows the order rows come in, raised where that order is left open. +pub const AGGREGATE_ORDER_DIVERGENCE: &str = "aggregate_row_order"; +/// What the guard of [`AGGREGATE_ORDER_DIVERGENCE`] raises. +pub const AGGREGATE_ORDER_ERROR: &str = + "the aggregate reads rows holding different values in an order neither engine fixes"; +/// The aggregates whose result follows the order they read rows in. +pub const COLLECTED_AGGREGATES: &[&str] = &[ + "array_agg", + "any_value", + "string_agg", + "json_agg", + "jsonb_agg", + "json_agg_strict", + "jsonb_agg_strict", + "json_object_agg", + "jsonb_object_agg", + "json_object_agg_strict", + "jsonb_object_agg_strict", + "json_object_agg_unique", + "jsonb_object_agg_unique", + "json_object_agg_unique_strict", + "jsonb_object_agg_unique_strict", +]; +/// The error a JSON object aggregate raises after the rejected-argument fragment for a NULL key. +pub const NULL_KEY_ERROR: &str = "null value not allowed for object key"; +/// The error a unique JSON object aggregate raises after the rejected-argument fragment for a repeated key. +pub const DUPLICATE_KEY_ERROR: &str = "duplicate JSON object key value"; /// What the row-order guard says after its divergence's tag. pub const ROW_ORDER_ERROR: &str = "a window call reads rows tied on every ORDER BY key, whose order neither engine fixes"; @@ -186,12 +213,22 @@ pub const JSON_SURROGATE: &str = r"(?i)\\ud[89a-f]"; pub const JSON_LENIENT: &str = "(?i),[ \\t\\n\\r]*[]}]|nan|inf"; /// Between a jsonb text's strings: what DuckDB's JSON does not hold as PostgreSQL's jsonb does: a fraction or exponent, an integer of 19 digits or more, a second key, whose order and repeats jsonb rewrites, and the numbers PostgreSQL rejects. pub const JSONB_UNHELD_TOKENS: &str = "(?i)[.]|[0-9]e|[0-9]{19}|:.*:|nan|inf"; +/// Between a json text's strings: the numbers DuckDB's `json()` writes otherwise than as written, a fraction or exponent, `-0` and an integer of 19 digits or more. +pub const JSON_REWRITTEN_TOKENS: &str = "(?i)[0-9][.e]|-0|[0-9]{19}"; +/// A `\u` escape, which DuckDB's `json()` may write otherwise than PostgreSQL's json functions. +pub const JSON_UNICODE_ESCAPE: &str = r"\\u"; /// In a jsonb text: the escapes PostgreSQL's jsonb writes otherwise than as written, `\u0000`, which it rejects, and a control's escape in capitals. pub const JSONB_UNHELD_ESCAPES: &str = r"\\u0000|\\u00[01][A-F]"; /// The controls whose `\u` escapes DuckDB spells in capitals and PostgreSQL in small letters. pub const JSON_CONTROLS: &str = r"[\x0B\x0E\x0F\x1A-\x1F]"; /// A path step PostgreSQL reads as an array index, as `strtol` reads it. pub const JSON_INDEX_STEP: &str = r"^[ \t\n\r\x0B\f]*([+-]?[0-9]+)$"; +/// A member whose value is JSON null and a comma follows, or else a whole string, so a global scan never starts inside one; replaced by the string alone. +pub const NULL_MEMBER: &str = r#""(?:[^"\\]|\\.)*":null,|("(?:[^"\\]|\\.)*")"#; +/// An object's last member whose value is JSON null, with the comma before it, and the `}` after it, or else a whole string; replaced by the `}` or the string. +pub const LAST_NULL_MEMBER: &str = r#",?"(?:[^"\\]|\\.)*":null(})|("(?:[^"\\]|\\.)*")"#; +/// An empty object or array on a line of DuckDB's pretty JSON, after the line's indent and text: PostgreSQL's `jsonb_pretty` breaks it over two lines. +pub const EMPTY_CONTAINER: &str = r#"(^|\n)( *)((?:[^"\n{\[]|"(?:[^"\\]|\\.)*")*)([{\[])([}\]])"#; /// Between JSON tokens outside strings, the `,` and `:` after which PostgreSQL's jsonb text puts a space. pub const JSON_RESPACE: &str = r#"((?:"(?:[^"\\]|\\.)*"|[^",:])*)([,:])"#; /// The error a JSON literal PostgreSQL rejects raises, read as malformed JSON. @@ -222,6 +259,9 @@ pub const SET_FUNCTIONS: &[&str] = &[ "jsonb_array_elements", "json_array_elements_text", "jsonb_array_elements_text", + "regexp_matches", + "regexp_split_to_table", + "string_to_table", ]; /// The lateral source a set-returning call becomes, and its element and position columns. pub const SET_RELATION: &str = "set"; @@ -268,6 +308,185 @@ pub const ASCII_UPPER: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; pub const ASCII_LOWER: &str = "abcdefghijklmnopqrstuvwxyz"; /// A run of the characters `initcap` starts words after, and a run of the rest, as an RE2 alternation. pub const INITCAP_WORDS: &str = "[A-Za-z0-9]+|[^A-Za-z0-9]+"; +/// An identifier `quote_ident` leaves unquoted, unless a keyword: an ASCII small letter or underscore, then small letters, digits and underscores. +pub const PLAIN_IDENTIFIER: &str = "[a-z_][a-z0-9_]*"; +/// The keywords `quote_ident` quotes, PostgreSQL 18's keywords other than its unreserved ones. +pub const QUOTED_KEYWORDS: &[&str] = &[ + "all", + "analyse", + "analyze", + "and", + "any", + "array", + "as", + "asc", + "asymmetric", + "authorization", + "between", + "bigint", + "binary", + "bit", + "boolean", + "both", + "case", + "cast", + "char", + "character", + "check", + "coalesce", + "collate", + "collation", + "column", + "concurrently", + "constraint", + "create", + "cross", + "current_catalog", + "current_date", + "current_role", + "current_schema", + "current_time", + "current_timestamp", + "current_user", + "dec", + "decimal", + "default", + "deferrable", + "desc", + "distinct", + "do", + "else", + "end", + "except", + "exists", + "extract", + "false", + "fetch", + "float", + "for", + "foreign", + "freeze", + "from", + "full", + "grant", + "greatest", + "group", + "grouping", + "having", + "ilike", + "in", + "initially", + "inner", + "inout", + "int", + "integer", + "intersect", + "interval", + "into", + "is", + "isnull", + "join", + "json", + "json_array", + "json_arrayagg", + "json_exists", + "json_object", + "json_objectagg", + "json_query", + "json_scalar", + "json_serialize", + "json_table", + "json_value", + "lateral", + "leading", + "least", + "left", + "like", + "limit", + "localtime", + "localtimestamp", + "merge_action", + "national", + "natural", + "nchar", + "none", + "normalize", + "not", + "notnull", + "null", + "nullif", + "numeric", + "offset", + "on", + "only", + "or", + "order", + "out", + "outer", + "overlaps", + "overlay", + "placing", + "position", + "precision", + "primary", + "real", + "references", + "returning", + "right", + "row", + "select", + "session_user", + "setof", + "similar", + "smallint", + "some", + "substring", + "symmetric", + "system_user", + "table", + "tablesample", + "then", + "time", + "timestamp", + "to", + "trailing", + "treat", + "trim", + "true", + "union", + "unique", + "user", + "using", + "values", + "varchar", + "variadic", + "verbose", + "when", + "where", + "window", + "with", + "xmlattributes", + "xmlconcat", + "xmlelement", + "xmlexists", + "xmlforest", + "xmlnamespaces", + "xmlparse", + "xmlpi", + "xmlroot", + "xmlserialize", + "xmltable", +]; +/// An unquoted identifier `parse_ident` reads: a letter, underscore or non-ASCII character, then those, digits and dollar signs. +pub const IDENTIFIER_WORD: &str = "[A-Za-z_\\x{80}-\\x{10FFFF}][A-Za-z0-9_$\\x{80}-\\x{10FFFF}]*"; +/// Unquoted identifiers joined by dots, each with the spaces PostgreSQL's scanner skips around it, as an RE2 pattern. +pub const DOTTED_IDENTIFIERS: &str = "[\\t\\n\\v\\f\\r ]*[A-Za-z_\\x{80}-\\x{10FFFF}][A-Za-z0-9_$\\x{80}-\\x{10FFFF}]*[\\t\\n\\v\\f\\r ]*(?:\\.[\\t\\n\\v\\f\\r ]*[A-Za-z_\\x{80}-\\x{10FFFF}][A-Za-z0-9_$\\x{80}-\\x{10FFFF}]*[\\t\\n\\v\\f\\r ]*)*"; +/// The characters PostgreSQL's scanner reads as space around an identifier. +pub const SCANNER_SPACES: &[char] = &[' ', '\t', '\n', '\r', '\u{b}', '\u{c}']; +/// The error `parse_ident` raises for text that is no qualified identifier, after the rejected-argument fragment. +pub const INVALID_IDENTIFIER_ERROR: &str = "string is not a valid identifier"; +/// The error `parse_ident` of a column raises for a double quote, whose quoted identifiers no rule reads. +pub const UNREAD_IDENTIFIER_ERROR: &str = "no rule reads a quoted identifier"; /// The most characters `lpad` and `rpad` return, as PostgreSQL's worst case of 4 bytes a character fits its allocation limit. pub const MAX_PADDED_LENGTH: i64 = 268_435_454; /// The most bytes `repeat` returns within PostgreSQL's allocation limit. @@ -369,6 +588,8 @@ pub const STRING_FUNCTIONS: &[&str] = &[ "normalize", "is_normalized", "unistr", + "quote_ident", + "parse_ident", ]; /// The functions only `bytea` has, or whose `bytea` form is the only one besides a bit string's. pub const BYTEA_FUNCTIONS: &[&str] = &[ @@ -381,6 +602,18 @@ pub const BYTEA_FUNCTIONS: &[&str] = &[ "bit_count", "sha256", ]; +/// The functions converting between text and an encoding's bytes. +pub const ENCODING_FUNCTIONS: &[&str] = &["convert_from", "convert_to", "convert"]; +/// The names PostgreSQL reads as UTF8 once case and everything but letters and digits are dropped. +pub const UTF8_NAMES: &[&str] = &["utf8", "unicode"]; +/// The names PostgreSQL reads as LATIN1, as [`UTF8_NAMES`]. +pub const LATIN1_NAMES: &[&str] = &["latin1", "iso88591"]; +/// The error bytes an encoding does not read raise after the rejected-argument fragment, SQLSTATE 22021 in PostgreSQL. +pub const INVALID_BYTES_ERROR: &str = "invalid byte sequence for encoding"; +/// The error a character LATIN1 has no byte for raises after the rejected-argument fragment, SQLSTATE 22P05 in PostgreSQL. +pub const UNMAPPED_CHARACTER_ERROR: &str = "character has no equivalent in encoding LATIN1"; +/// The error a column naming an encoding other than UTF8 or LATIN1 raises. +pub const UNREAD_ENCODING_ERROR: &str = "no rule converts this encoding, only UTF8 and LATIN1"; /// The functions text and `bytea` both have, read as `bytea` when an argument is one. pub const SHARED_BYTEA_FUNCTIONS: &[&str] = &[ "length", @@ -397,8 +630,11 @@ pub const SHARED_BYTEA_FUNCTIONS: &[&str] = &[ "overlay", "reverse", ]; -/// The regular expression functions [`PATTERN_RULE`] converts. +/// The regular expression and text-splitting functions [`PATTERN_RULE`] converts as scalars. pub const REGEX_FUNCTIONS: &[&str] = &[ + "regexp_match", + "regexp_split_to_array", + "string_to_array", "regexp_like", "regexp_count", "regexp_instr", @@ -412,8 +648,26 @@ pub const REGEX_ARITY: &[(&str, usize)] = &[ ("regexp_instr", 7), ("regexp_substr", 6), ("regexp_replace", 6), - ("substring", 2), + ("regexp_match", 3), + ("regexp_matches", 3), + ("regexp_split_to_array", 3), + ("regexp_split_to_table", 3), + ("string_to_array", 3), + ("string_to_table", 3), + ("substring", 3), ]; +/// The set-returning forms of [`REGEX_FUNCTIONS`]' lists, and the list each unnests. +pub const SPLIT_SETS: &[(&str, &str)] = &[ + ("regexp_matches", "regexp_match"), + ("regexp_split_to_table", "regexp_split_to_array"), + ("string_to_table", "string_to_array"), +]; +/// The error `substring(x SIMILAR p ESCAPE e)` raises after the rejected-argument fragment for an escape of more than one character. +pub const INVALID_ESCAPE_ERROR: &str = "invalid escape string"; +/// The anchors a pattern splitting text may not hold: RE2 splits at an empty match where `^` or `$` stands, which PostgreSQL skips. +pub const SPLIT_ANCHORS: &[char] = &['^', '$']; +/// [`PATTERN_OPERATOR_TEST`] with [`SPLIT_ANCHORS`], as an RE2 test of a splitting pattern a column holds. +pub const SPLIT_PATTERN_TEST: &str = r"[\\\[\]{}()|*+?^$]"; /// The operators that match a regular expression or a prefix. pub const PATTERN_OPERATORS: &[&str] = &["~", "~*", "!~", "!~*", "^@"]; /// The most levels deep a statement may nest before conversion refuses it. @@ -546,6 +800,9 @@ pub const UNIT_TOKEN_LENGTH: usize = 10; pub const UNIT_ERROR: &str = "unit not recognized"; /// The error a unit raises that PostgreSQL reads and no rule converts. pub const UNREAD_UNIT_ERROR: &str = "no rule reads this unit as PostgreSQL reads it"; +/// The guard `extract` of a rising field raises for an infinite timestamp, whose numeric infinity DuckDB's DECIMAL cannot hold. +pub const INFINITE_FIELD_ERROR: &str = + "no rule holds the numeric infinity extract gives an infinite timestamp"; /// The error a `date_bin` stride of no length raises after the rejected-argument fragment, as PostgreSQL's message reads. pub const STRIDE_ERROR: &str = "stride must be greater than zero"; /// The error a `date_bin` stride with months raises, which PostgreSQL does not bin into. @@ -709,8 +966,63 @@ pub const UNREAD_FACTORIAL_ERROR: &str = pub const UUID_VERSION_DIGIT: usize = 15; /// See [`UUID_VERSION_DIGIT`]. pub const UUID_VARIANT_DIGIT: usize = 20; +/// The microseconds from the Gregorian calendar's start, 1582-10-15, to 1970-01-01, where a version 1 UUID's clock counts from. +pub const GREGORIAN_TO_UNIX_MICROS: i64 = 12_219_292_800_000_000; /// PostgreSQL's `RADIANS_PER_DEGREE`, as the DOUBLE literal it rounds to. pub const RADIANS_PER_DEGREE: &str = "1.7453292519943295e-2"; +/// The bits of [`RADIANS_PER_DEGREE`]. +pub const RADIANS_PER_DEGREE_BITS: u64 = 0x3F91_DF46_A252_9D39; +/// The largest angle PostgreSQL's degree sine computes with `sin` rather than `cos` of its complement. +pub const SINE_SWITCH_DEGREES: f64 = 30.0; +/// The largest angle PostgreSQL's degree cosine computes with `cos` rather than `sin` of its complement. +pub const COSINE_SWITCH_DEGREES: f64 = 60.0; +/// The largest value PostgreSQL's degree arcsine computes with `asin` rather than `acos`. +pub const ARCSINE_SWITCH: f64 = 0.5; +/// A quarter turn in degrees, the end of the first quadrant. +pub const QUARTER_TURN: f64 = 90.0; +/// A half turn in degrees. +pub const HALF_TURN: f64 = 180.0; +/// Three quarter turns in degrees. +pub const THREE_QUARTER_TURN: f64 = 270.0; +/// The bound of the domain of `asin`, `acos` and `atanh`, and the least value `acosh` takes. +pub const UNIT_BOUND: f64 = 1.0; +/// The function of the natural logarithm; `log` and `log10` both compute the common one. +pub const NATURAL_LOG_FUNCTION: &str = "ln"; +/// The degree arc cosine, the complement of the degree arc sine. +pub const ARC_COSINE_DEGREES_FUNCTION: &str = "acosd"; +/// The bits of `sin(30 * RADIANS_PER_DEGREE)`, which PostgreSQL's degree functions compute once with glibc and divide by. +pub const SIN_30_BITS: u64 = 0x3FDF_FFFF_FFFF_FFFF; +/// The bits of `1 - cos(60 * RADIANS_PER_DEGREE)`, as [`SIN_30_BITS`]. +pub const ONE_MINUS_COS_60_BITS: u64 = 0x3FDF_FFFF_FFFF_FFFE; +/// The bits of `asin(0.5)`, as [`SIN_30_BITS`]. +pub const ASIN_HALF_BITS: u64 = 0x3FE0_C152_382D_7366; +/// The bits of `acos(0.5)`, as [`SIN_30_BITS`]. +pub const ACOS_HALF_BITS: u64 = 0x3FF0_C152_382D_7366; +/// The bits of `atan(1)`, as [`SIN_30_BITS`]; `tan 45` and `cot 45`, the other constants, are exactly 1. +pub const ATAN_ONE_BITS: u64 = 0x3FE9_21FB_5444_2D18; +/// The largest constant `gamma` and `lgamma` need no check for: from the smallest positive normal number up to it, both are finite and `gamma` nonzero. +pub const MAX_UNCHECKED_GAMMA: f64 = 171.0; +/// The largest constant whose `exp` is a finite, nonzero, normal number, so it needs no check. +pub const MAX_UNCHECKED_EXP: f64 = 700.0; +/// The error a `float8` function raises for an argument outside its domain, an overflow (SQLSTATE 22003) in PostgreSQL. +pub const INPUT_RANGE_ERROR: &str = "input is out of range"; +/// The error `ln`, `log` and `log10` raise after the rejected-argument fragment for zero. +pub const LOG_ZERO_ERROR: &str = "cannot take logarithm of zero"; +/// The error `ln`, `log` and `log10` raise after the rejected-argument fragment for a negative number. +pub const LOG_NEGATIVE_ERROR: &str = "cannot take logarithm of a negative number"; +/// The error `power` raises after the rejected-argument fragment for zero to a negative power. +pub const ZERO_POWER_ERROR: &str = "zero raised to a negative power is undefined"; +/// The error `power` raises after the rejected-argument fragment for a negative number to a fractional power. +pub const COMPLEX_POWER_ERROR: &str = + "a negative number raised to a non-integer power yields a complex result"; +/// The `float8` functions PostgreSQL computes with one C library call or its own degree-based trigonometry. +pub const FLOAT_FUNCTIONS: &[&str] = &[ + "sin", "cos", "tan", "cot", "asin", "acos", "atan", "atan2", "sinh", "cosh", "tanh", "asinh", + "acosh", "atanh", "cbrt", "||/", "exp", "ln", "log", "log10", "gamma", "lgamma", "power", + "pow", "sind", "cosd", "tand", "cotd", "asind", "acosd", "atand", "atan2d", "erf", "erfc", +]; +/// The functions of [`FLOAT_FUNCTIONS`] PostgreSQL also has for `numeric`, computed to its own precision. +pub const NUMERIC_OVERLOADS: &[&str] = &["exp", "ln", "log", "log10", "power", "pow"]; /// The error a pattern raises when no rule shows RE2 or LIKE reads it as PostgreSQL does. pub const UNREAD_PATTERN_ERROR: &str = "no rule reads this pattern as PostgreSQL reads it"; /// The error `regexp_replace` raises for a backslash in the replacement, whose escapes no rule reads. @@ -775,6 +1087,9 @@ pub const JSON_FUNCTIONS: &[&str] = &[ "json_object", "jsonb_object", "json_serialize", + "json_strip_nulls", + "jsonb_strip_nulls", + "jsonb_pretty", ]; /// Zero as a DOUBLE, which both signed zeros equal. @@ -977,3 +1292,5 @@ pub const SESSION_QUERY: &str = "SELECT 'timezone' AS name, CASE current_setting ELSE current_setting('TimeZone') END AS value"; /// The column constraint naming a table's primary key, which a table declares at most once. pub const PRIMARY_KEY: &str = "PRIMARY KEY"; +/// The construct a function call's argument is recorded under in its shape; it opens no rule, so it records no shape of its own. +pub const ARGUMENT_CONSTRUCT: &str = "argument"; diff --git a/crates/sqlbabel-convert/src/postgres/conversion/tests.rs b/crates/sqlbabel-convert/src/postgres/conversion/tests.rs index 3a0c3ad5b..7e18a1da6 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/tests.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/tests.rs @@ -1,3 +1,5 @@ +#[path = "tests/helpers.rs"] +mod helpers; #[path = "tests/test_convert.rs"] mod test_convert; #[path = "tests/test_convert_effect.rs"] diff --git a/crates/sqlbabel-convert/src/postgres/conversion/tests/helpers.rs b/crates/sqlbabel-convert/src/postgres/conversion/tests/helpers.rs new file mode 100644 index 000000000..c4b2655a5 --- /dev/null +++ b/crates/sqlbabel-convert/src/postgres/conversion/tests/helpers.rs @@ -0,0 +1,27 @@ +use crate::postgres::analysis::main::analyze::analyze; + +/// The function calls `sql`'s conversion records, each written `NAME(FAMILY, ...)`, sorted. +pub(crate) fn recorded_calls(sql: &str) -> Vec { + let converted = analyze(sql).unwrap_or_else(|refusal| panic!("{sql}: {}", refusal.reason)); + let mut calls: Vec = converted + .provenance + .shapes + .into_values() + .flatten() + .filter_map(|shape| { + let name = shape.construct.strip_prefix("fn:")?.to_owned(); + Some(format!("{name}({})", families(&shape.arguments).join(", "))) + }) + .collect(); + calls.sort(); + calls.dedup(); + calls +} + +/// The type family of each argument, in order. +fn families(arguments: &[sqlbabel_diagnostics::provenance::models::ShapeArgument]) -> Vec { + arguments + .iter() + .map(|argument| argument.family.clone()) + .collect() +} diff --git a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert.rs b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert.rs index 58ac5f4b4..5f9f3a99a 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert.rs @@ -4,8 +4,10 @@ use sqlbabel_diagnostics::refusals::models::RefusalCategory; use crate::postgres::analysis::main::analyze::analyze; use crate::postgres::conversion::models::PostgresType; +use crate::postgres::conversion::tests::helpers::recorded_calls; use crate::postgres::conversion::tests::test_types::{ - CategoryTestCase, ConstructTestCase, ConvertTestCase, DivergenceTestCase, RefuseTestCase, + CategoryTestCase, ConstructTestCase, ConvertTestCase, DivergenceTestCase, RecordedCallTestCase, + RefuseTestCase, }; const FIXTURE: &str = "WITH input AS (SELECT * FROM (VALUES (1, CAST(-7 AS integer), CAST('a' AS text), \ @@ -110,6 +112,22 @@ fn given_a_query_over_the_fixture_when_converted_then_duckdb_sql_computes_as_pos ], expected_types: &[PostgresType::Double, PostgresType::Double], }, + ConvertTestCase { + description: "json_strip_nulls raises where DuckDB's json() would rewrite a number or an escape", + query: "SELECT json_strip_nulls(CAST(s AS json)) AS r FROM input", + expected_sql: &["'(?i)[0-9][.e]|-0|[0-9]{19}') OR regexp_matches("], + expected_types: &[PostgresType::JsonText], + }, + ConvertTestCase { + description: "div scales both arguments to whole numbers at the wider scale, a literal folded", + query: "SELECT div(x1, 0.5) AS r FROM input", + expected_sql: &["((CAST(\"x1\" AS HUGEINT) * 10) // 5) AS DECIMAL(11, 0))"], + expected_types: &[PostgresType::Numeric { + precision: 11, + scale: 0, + declared: false, + }], + }, ConvertTestCase { description: "gcd of numeric literals folds at the wider scale", query: "SELECT gcd(7, 2.5) AS r FROM input", @@ -284,15 +302,44 @@ fn given_a_query_over_the_fixture_when_converted_then_duckdb_sql_computes_as_pos } #[test] -fn given_text_cast_to_bit_varying_when_converted_then_it_relies_on_the_empty_bit_string_divergence() -{ - let test_cases = [DivergenceTestCase { - description: "text cast to bit varying may be empty, which DuckDB's BIT cannot hold", - query: "SELECT CAST(s AS bit varying) AS r FROM input", - divergence: "empty_bit_string", - expected_constructs: Some(&["cast:VARBIT"]), - expected_sql: "error('empty_bit_string: ", - }]; +fn given_a_construct_a_divergence_guards_when_converted_then_it_relies_on_it_only_where_it_must() { + let test_cases = [ + DivergenceTestCase { + description: "text cast to bit varying may be empty, which DuckDB's BIT cannot hold", + query: "SELECT CAST(s AS bit varying) AS r FROM input", + divergence: "empty_bit_string", + expected_constructs: Some(&["cast:VARBIT"]), + expected_sql: "error('empty_bit_string: ", + }, + DivergenceTestCase { + description: "string_agg without ORDER BY reads rows in an order neither engine fixes", + query: "SELECT string_agg(s, ',') AS r FROM input", + divergence: "aggregate_row_order", + expected_constructs: Some(&["fn:STRING_AGG"]), + expected_sql: "WHEN count(DISTINCT {'v': \"s\"}) FILTER (WHERE \"s\" IS NOT NULL) > 1 THEN", + }, + DivergenceTestCase { + description: "json_agg ordered by its value needs no guard: rows tied on it hold one value", + query: "SELECT json_agg(x1 ORDER BY x1) AS r FROM input", + divergence: "aggregate_row_order", + expected_constructs: None, + expected_sql: "SELECT '[' || array_to_string(list(coalesce(CAST(to_json(\"x1\") AS VARCHAR), 'null') ORDER BY \"x1\" ASC NULLS LAST), ', ') || ']' AS", + }, + DivergenceTestCase { + description: "string_agg(DISTINCT) ordered by its value keeps DISTINCT and needs no guard", + query: "SELECT string_agg(DISTINCT s, ',' ORDER BY s DESC) AS r FROM input", + divergence: "aggregate_row_order", + expected_constructs: None, + expected_sql: "SELECT string_agg(DISTINCT \"s\", ',' ORDER BY \"s\" DESC NULLS FIRST) AS", + }, + DivergenceTestCase { + description: "jsonb_object_agg orders its keys itself, so only a key holding two values raises", + query: "SELECT jsonb_object_agg(s, x1) AS r FROM input", + divergence: "aggregate_row_order", + expected_constructs: Some(&["fn:JSONB_OBJECT_AGG"]), + expected_sql: "count(DISTINCT {'k1': CAST(\"s\" AS VARCHAR), 'k': CAST(\"s\" AS VARCHAR), 'v': CAST(to_json(\"x1\") AS VARCHAR)}) > count(DISTINCT {'k1': CAST(\"s\" AS VARCHAR)})", + }, + ]; for test_case in test_cases { let converted = analyze(&format!("{FIXTURE}{}", test_case.query)).unwrap_or_else(|refusal| { @@ -327,13 +374,13 @@ fn given_an_unconverted_function_or_empty_bit_string_when_converted_then_the_ref { let test_cases = [ ConstructTestCase { - description: "acos of a double has no rule", - query: "SELECT acos(d) AS r FROM input", - expected_construct: "fn:ACOS", + description: "erf of a double has no rule, as DuckDB has no erf", + query: "SELECT erf(d) AS r FROM input", + expected_construct: "fn:ERF", }, ConstructTestCase { description: "an operator is named by its node", - query: "SELECT 2.5 ^ 2.5 AS r FROM input", + query: "SELECT s @@ s AS r FROM input", expected_construct: "node:operator", }, ConstructTestCase { @@ -370,11 +417,23 @@ fn given_an_unconverted_function_or_empty_bit_string_when_converted_then_the_ref #[test] fn given_a_function_whose_rewrite_has_no_sql_for_its_arguments_when_converted_then_it_lacks_a_rule() { - let test_cases = [CategoryTestCase { - description: "factorial of a double, outside its rewrite and never recorded as a rejection", - query: "SELECT factorial(d) AS r FROM input", - expected_category: RefusalCategory::MissingRule, - }]; + let test_cases = [ + CategoryTestCase { + description: "factorial of a double, outside its rewrite and never recorded as a rejection", + query: "SELECT factorial(d) AS r FROM input", + expected_category: RefusalCategory::MissingRule, + }, + CategoryTestCase { + description: "unary minus of text, which PostgreSQL has no operator for", + query: "SELECT - s AS r FROM input", + expected_category: RefusalCategory::TypeCondition, + }, + CategoryTestCase { + description: "unary minus of a string literal, for which PostgreSQL finds no one operator", + query: "SELECT - '5' AS r FROM input", + expected_category: RefusalCategory::TypeCondition, + }, + ]; for test_case in test_cases { let refusal = analyze(&format!("{FIXTURE}{}", test_case.query)).expect_err(test_case.description); @@ -407,9 +466,9 @@ fn given_a_statement_postgresql_rejects_or_compares_differently_when_converted_t expected_refused: true, }, RefuseTestCase { - description: "extract of a timestamp's year, infinite for an infinite timestamp, which no DECIMAL holds", + description: "extract of a timestamp's year converts, raising for an infinite timestamp no DECIMAL holds", query: "SELECT extract(year FROM TIMESTAMP '2016-07-30 12:00') AS r FROM input", - expected_refused: true, + expected_refused: false, }, RefuseTestCase { description: "a time zone abbreviation, which PostgreSQL and DuckDB read as different zones", @@ -516,6 +575,41 @@ fn given_a_statement_postgresql_rejects_or_compares_differently_when_converted_t query: "SELECT '\"\\ud800\"' IS JSON AS r FROM input", expected_refused: true, }, + RefuseTestCase { + description: "json_agg(DISTINCT), whose order PostgreSQL takes from sorting its values", + query: "SELECT json_agg(DISTINCT x1) AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "array_agg of an untyped literal, whose type PostgreSQL cannot resolve", + query: "SELECT array_agg('a' ORDER BY ordinal) AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "any_value of a character(n) value, whose padding PostgreSQL keeps", + query: "SELECT any_value(CAST(s AS char(3))) AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "num_nulls of VARIADIC NULL, which PostgreSQL rejects as no array", + query: "SELECT num_nulls(VARIADIC NULL) AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "string_agg(DISTINCT) in no stated order, which no guard reads as PostgreSQL sorts it", + query: "SELECT string_agg(DISTINCT s, ',') AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "json_agg ordered by a double, whose -0 and 0 tie in PostgreSQL", + query: "SELECT json_agg(x1 ORDER BY d) AS r FROM input", + expected_refused: true, + }, + RefuseTestCase { + description: "string_agg over a window, which PostgreSQL rejects", + query: "SELECT string_agg(s, ',') OVER () AS r FROM input", + expected_refused: true, + }, RefuseTestCase { description: "an operator on json kept as written, which DuckDB's JSON does not hold", query: "SELECT '{\"a\": 1}'::json -> 'a' AS r FROM input", @@ -531,3 +625,28 @@ fn given_a_statement_postgresql_rejects_or_compares_differently_when_converted_t ); } } + +#[test] +fn given_function_calls_when_converted_then_each_records_its_arguments_type_families() { + let test_cases = [ + RecordedCallTestCase { + description: "length of text and of bytea record their own families, so each links to its own form", + query: "SELECT length(s) AS a, length(CAST(s AS bytea)) AS b FROM input", + expected_calls: &["LENGTH(BYTEA)", "LENGTH(TEXT)"], + }, + RecordedCallTestCase { + description: "a nested call records the outer call with the inner call's result type", + query: "SELECT upper(lower(s)) AS a FROM input", + expected_calls: &["LOWER(TEXT)", "UPPER(TEXT)"], + }, + ]; + + for test_case in test_cases { + assert_eq!( + recorded_calls(&format!("{FIXTURE}{}", test_case.query)), + test_case.expected_calls, + "{}", + test_case.description + ); + } +} diff --git a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert_effect.rs b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert_effect.rs index 7d5359a3f..4e2dc6c4f 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert_effect.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_convert_effect.rs @@ -69,7 +69,7 @@ fn given_effect_statements_when_converted_then_duckdb_runs_them_alike_or_they_ar setup: &["CREATE TABLE t (a integer)"], statements: &["DROP TABLE t, u"], expected_statements: &[], - expected_refusal: "`u` is no table", + expected_refusal: "this script doesn't define table `u`", }, EffectTestCase { description: "dropping a table a view may read is refused, as PostgreSQL refuses and DuckDB drops it", diff --git a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_types.rs b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_types.rs index cb90321b3..2a81f385f 100644 --- a/crates/sqlbabel-convert/src/postgres/conversion/tests/test_types.rs +++ b/crates/sqlbabel-convert/src/postgres/conversion/tests/test_types.rs @@ -50,3 +50,11 @@ pub(crate) struct EffectTestCase { /// A fragment of the refusal's reason; empty when the statements convert. pub(crate) expected_refusal: &'static str, } + +/// A query over the fixture and the function calls its conversion records, each with its arguments' type families. +pub(crate) struct RecordedCallTestCase { + pub(crate) description: &'static str, + pub(crate) query: &'static str, + /// Each call written `NAME(FAMILY, ...)`, sorted. + pub(crate) expected_calls: &'static [&'static str], +} diff --git a/crates/sqlbabel-evidence/src/cases/_helpers/loading.rs b/crates/sqlbabel-evidence/src/cases/_helpers/loading.rs index ed6be578e..2edeb1303 100644 --- a/crates/sqlbabel-evidence/src/cases/_helpers/loading.rs +++ b/crates/sqlbabel-evidence/src/cases/_helpers/loading.rs @@ -20,6 +20,28 @@ use crate::constants::{ use crate::dialects::main::evidence_profile::evidence_profile; use crate::dialects::types::EvidenceProfile; +/// `file` with each case the policy lists under `expected_divergences` expecting that divergence, and a problem for each listed case that also declares one. +pub(crate) fn with_listed_divergences( + relative: &str, + mut file: CaseFile, + policy: &Policy, +) -> (CaseFile, Vec) { + let mut problems: Vec = Vec::new(); + for case in &mut file.cases { + let reference = format!("{relative}#{}", case.id); + let Some(id) = policy.expected_divergences.get(&reference) else { + continue; + }; + match case.expected_divergence { + Some(_) => problems.push(format!( + "{reference}: declares expected_divergence and is listed under the policy's expected_divergences" + )), + None => case.expected_divergence = Some(id.clone()), + } + } + (file, problems) +} + pub(crate) fn load_file( relative: &str, file: &CaseFile, diff --git a/crates/sqlbabel-evidence/src/cases/main/load_cases.rs b/crates/sqlbabel-evidence/src/cases/main/load_cases.rs index d0ba49cbb..6e6339a82 100644 --- a/crates/sqlbabel-evidence/src/cases/main/load_cases.rs +++ b/crates/sqlbabel-evidence/src/cases/main/load_cases.rs @@ -5,15 +5,17 @@ use std::path::Path; use sqlbabel_policy::policy::models::Policy; use crate::cases::_helpers::files::read_case_files; -use crate::cases::_helpers::loading::load_file; +use crate::cases::_helpers::loading::{load_file, with_listed_divergences}; use crate::cases::models::LoadedCase; use crate::errors::EvidenceError; -/// Loads and validates every `.toml` case file under `directory`, sorted by reference. +/// Loads and validates every `.toml` case file under `directory`, sorted by reference, each case the policy lists under `expected_divergences` expecting its divergence; [`missing_listed`](crate::cases::main::missing_listed::missing_listed) checks the list against the whole cases root. pub fn load_cases(directory: &Path, policy: &Policy) -> Result, EvidenceError> { let mut cases: Vec = Vec::new(); let mut problems: Vec = Vec::new(); for (relative, file) in read_case_files(directory)? { + let (file, declared) = with_listed_divergences(&relative, file, policy); + problems.extend(declared); match load_file(&relative, &file, policy) { Ok(loaded) => cases.extend(loaded), Err(found) => problems.extend(found), diff --git a/crates/sqlbabel-evidence/src/cases/main/missing_listed.rs b/crates/sqlbabel-evidence/src/cases/main/missing_listed.rs new file mode 100644 index 000000000..0aa7875b6 --- /dev/null +++ b/crates/sqlbabel-evidence/src/cases/main/missing_listed.rs @@ -0,0 +1,20 @@ +//! `missing_listed`: the cases a policy's `expected_divergences` lists that the loaded cases lack. + +use std::collections::BTreeSet; + +use sqlbabel_policy::policy::models::Policy; + +use crate::cases::models::LoadedCase; + +/// A problem for each case `policy` lists under `expected_divergences` that `cases`, loaded from the whole cases root, do not hold. +pub fn missing_listed(policy: &Policy, cases: &[LoadedCase]) -> Vec { + let loaded: BTreeSet<&str> = cases.iter().map(|case| case.reference.as_str()).collect(); + policy + .expected_divergences + .keys() + .filter(|reference| !loaded.contains(reference.as_str())) + .map(|reference| { + format!("expected_divergences: no case {reference} under the cases directory") + }) + .collect() +} diff --git a/crates/sqlbabel-evidence/src/cases/main/mod.rs b/crates/sqlbabel-evidence/src/cases/main/mod.rs index 89fd6e552..c3bd8130a 100644 --- a/crates/sqlbabel-evidence/src/cases/main/mod.rs +++ b/crates/sqlbabel-evidence/src/cases/main/mod.rs @@ -1,2 +1,3 @@ pub mod effect_parts; pub mod load_cases; +pub mod missing_listed; diff --git a/crates/sqlbabel-evidence/src/cases/tests/helpers.rs b/crates/sqlbabel-evidence/src/cases/tests/helpers.rs index 5ac314f54..62055fba5 100644 --- a/crates/sqlbabel-evidence/src/cases/tests/helpers.rs +++ b/crates/sqlbabel-evidence/src/cases/tests/helpers.rs @@ -4,6 +4,7 @@ use sqlbabel_policy::policy::main::load_policy::load_policy; use sqlbabel_policy::policy::models::Policy; use crate::cases::main::load_cases::load_cases; +use crate::cases::main::missing_listed::missing_listed; use crate::cases::models::LoadedCase; pub(crate) const POLICY: &str = r#" @@ -165,3 +166,32 @@ pub(crate) fn row_source_count(reference: &str, (replace, with): (&str, &str)) - .find(|case| case.reference == reference) .map(|case| case.row_sources.len()) } + +/// A divergence the test policy declares, for cases to expect. +const ROW_ORDER_DIVERGENCE: &str = "\n[divergences.row_order]\nconstructs = [\"fn:STRING_AGG\"]\nreplay = \"warn\"\n\ + default = \"allow\"\nreason = \"order\"\nfailure = \"loud\"\nnative_errors = [\"Invalid Input Error: row_order: *\"]\n"; + +/// The cases once `replace` becomes `with`, under the test policy with a row-order divergence and `listed` appended, or the problem loading the policy or the cases, or a listed case they lack. +pub(crate) fn load_listed( + directory: &Path, + (replace, with): (&str, &str), + listed: &str, +) -> Result, String> { + let cases = directory.join("cases"); + std::fs::create_dir_all(cases.join("string")).expect("cases directory"); + std::fs::write( + cases.join("string").join("concat.toml"), + CASE_FILE.replacen(replace, with, 1), + ) + .expect("case file written"); + let path = directory.join("sqlbabel.toml"); + std::fs::write(&path, format!("{POLICY}{ROW_ORDER_DIVERGENCE}{listed}")) + .expect("policy written"); + let policy = load_policy(&path).map_err(|error| error.to_string())?; + let loaded = load_cases(&cases, &policy).map_err(|error| error.to_string())?; + let missing = missing_listed(&policy, &loaded); + missing + .is_empty() + .then_some(loaded) + .ok_or_else(|| missing.join("; ")) +} diff --git a/crates/sqlbabel-evidence/src/cases/tests/test_load_cases.rs b/crates/sqlbabel-evidence/src/cases/tests/test_load_cases.rs index d471f8bc5..d9ae76088 100644 --- a/crates/sqlbabel-evidence/src/cases/tests/test_load_cases.rs +++ b/crates/sqlbabel-evidence/src/cases/tests/test_load_cases.rs @@ -1,8 +1,10 @@ use crate::cases::tests::helpers::{ - observed_problem, observed_problem_in, row_source_count, row_source_ordinal, source_sql_of, + load_listed, observed_problem, observed_problem_in, row_source_count, row_source_ordinal, + source_sql_of, }; use crate::cases::tests::test_types::{ - DialectLoadTestCase, LoadTestCase, RowOrdinalTestCase, RowSourceTestCase, SourceSqlTestCase, + DialectLoadTestCase, ListedDivergenceTestCase, LoadTestCase, RowOrdinalTestCase, + RowSourceTestCase, SourceSqlTestCase, }; #[test] @@ -783,3 +785,86 @@ fn given_a_query_selecting_the_ordinal_when_splitting_rows_then_each_row_keeps_i ); } } + +#[test] +fn given_cases_the_policy_lists_when_loading_then_each_expects_its_divergence_and_the_list_fails_closed() + { + let listed = "\n[expected_divergences]\n\"string/concat.toml#sorted\" = \"row_order\"\n"; + let test_cases = [ + ListedDivergenceTestCase { + description: "no list: the sorted case expects nothing", + listed: "", + replace: "", + with: "", + expected_divergence: None, + expected_problem: None, + }, + ListedDivergenceTestCase { + description: "the sorted case listed: it expects the listed divergence", + listed, + replace: "", + with: "", + expected_divergence: Some("row_order"), + expected_problem: None, + }, + ListedDivergenceTestCase { + description: "a listed case that does not exist", + listed: "\n[expected_divergences]\n\"string/concat.toml#absent\" = \"row_order\"\n", + replace: "", + with: "", + expected_divergence: None, + expected_problem: Some( + "expected_divergences: no case string/concat.toml#absent under the cases directory", + ), + }, + ListedDivergenceTestCase { + description: "a listed case that also declares a divergence", + listed, + replace: "tags = []", + with: "expected_divergence = \"row_order\"\ntags = []", + expected_divergence: None, + expected_problem: Some( + "string/concat.toml#sorted: declares expected_divergence and is listed", + ), + }, + ListedDivergenceTestCase { + description: "a listed case naming a divergence the policy does not declare", + listed: "\n[expected_divergences]\n\"string/concat.toml#sorted\" = \"row_ordre\"\n", + replace: "", + with: "", + expected_divergence: None, + expected_problem: Some( + "expected_divergences: string/concat.toml#sorted names unknown divergence `row_ordre`", + ), + }, + ]; + for test_case in test_cases { + let directory = tempfile::tempdir().expect("directory"); + let loaded = load_listed( + directory.path(), + (test_case.replace, test_case.with), + test_case.listed, + ); + let divergence = loaded.as_ref().ok().and_then(|cases| { + cases + .iter() + .find(|case| case.reference.ends_with("#sorted")) + .and_then(|case| case.expected_divergence.clone()) + }); + let problem = loaded.err().unwrap_or_default(); + assert_eq!( + (divergence.as_deref(), !problem.is_empty()), + ( + test_case.expected_divergence, + test_case.expected_problem.is_some() + ), + "{}: {problem}", + test_case.description + ); + assert!( + problem.contains(test_case.expected_problem.unwrap_or_default()), + "{}: {problem}", + test_case.description + ); + } +} diff --git a/crates/sqlbabel-evidence/src/cases/tests/test_types.rs b/crates/sqlbabel-evidence/src/cases/tests/test_types.rs index 55361d7d6..348055349 100644 --- a/crates/sqlbabel-evidence/src/cases/tests/test_types.rs +++ b/crates/sqlbabel-evidence/src/cases/tests/test_types.rs @@ -48,3 +48,14 @@ pub(crate) struct RowSourceTestCase { pub(crate) with: &'static str, pub(crate) expected_rows: Option, } + +/// A load under a policy listing cases under `expected_divergences`, the divergence the sorted case expects, and the problem, if any. +pub(crate) struct ListedDivergenceTestCase { + pub(crate) description: &'static str, + /// The policy's `[expected_divergences]` table, or nothing. + pub(crate) listed: &'static str, + pub(crate) replace: &'static str, + pub(crate) with: &'static str, + pub(crate) expected_divergence: Option<&'static str>, + pub(crate) expected_problem: Option<&'static str>, +} diff --git a/crates/sqlbabel-evidence/src/postgres/profile/constants.rs b/crates/sqlbabel-evidence/src/postgres/profile/constants.rs index d0934902b..593b7da64 100644 --- a/crates/sqlbabel-evidence/src/postgres/profile/constants.rs +++ b/crates/sqlbabel-evidence/src/postgres/profile/constants.rs @@ -115,8 +115,12 @@ pub const SQLSTATE_KINDS: &[(&str, ErrorKind)] = &[ ("22014", ErrorKind::InvalidArgument), ("22016", ErrorKind::InvalidArgument), ("2202E", ErrorKind::InvalidArgument), + ("22025", ErrorKind::InvalidArgument), + ("22021", ErrorKind::InvalidArgument), + ("22P05", ErrorKind::InvalidArgument), ("21000", ErrorKind::InvalidArgument), ("22004", ErrorKind::InvalidArgument), + ("22030", ErrorKind::InvalidArgument), ("22001", ErrorKind::StringTooLong), ]; diff --git a/crates/sqlbabel-policy/policy-postgres.toml b/crates/sqlbabel-policy/policy-postgres.toml index 88ae59469..b33ff5f12 100644 --- a/crates/sqlbabel-policy/policy-postgres.toml +++ b/crates/sqlbabel-policy/policy-postgres.toml @@ -204,6 +204,26 @@ failure = "loud" reason = "row_number, ntile, lag, lead, first_value, last_value and nth_value, and an aggregate over a ROWS frame, read a window's rows in order, and rows tied on every ORDER BY key come in an order neither PostgreSQL nor DuckDB fixes. The converted SQL computes them where the partition holds no such ties, and raises otherwise. The failure is loud, never a wrong value." native_errors = ["Invalid Input Error: window_row_order: *"] +[divergences.aggregate_row_order] +constructs = ["fn:ARRAY_AGG", "fn:ANY_VALUE", "fn:STRING_AGG", "fn:JSON_AGG", "fn:JSONB_AGG", "fn:JSON_AGG_STRICT", "fn:JSONB_AGG_STRICT", "fn:JSON_OBJECT_AGG", "fn:JSONB_OBJECT_AGG", "fn:JSON_OBJECT_AGG_STRICT", "fn:JSONB_OBJECT_AGG_STRICT", "fn:JSON_OBJECT_AGG_UNIQUE", "fn:JSONB_OBJECT_AGG_UNIQUE", "fn:JSON_OBJECT_AGG_UNIQUE_STRICT", "fn:JSONB_OBJECT_AGG_UNIQUE_STRICT"] +replay = "warn" +default = "allow" +failure = "loud" +reason = "array_agg, any_value, string_agg and the JSON aggregates return their rows' values in the order they read them, which PostgreSQL leaves open without an ORDER BY in the call, and among rows tied on every ORDER BY key. The converted SQL computes them where those rows hold one value, or for jsonb objects one value per key, and raises otherwise. The failure is loud, never a wrong value." +native_errors = ["Invalid Input Error: aggregate_row_order: *"] + # Effect statements PostgreSQL reports no affected-row count for, where DuckDB reports one. [uncounted_statements] "TRUNCATE TABLE" = "PostgreSQL's TRUNCATE command tag carries no row count; DuckDB reports the rows it removed. The table probes compare the rows left." + +# Generated cases recorded before conversion guarded row order: their rows hold different values with no +# ORDER BY, so PostgreSQL's result follows an order neither engine fixes. The evidence is append-only, so +# the expected divergence is named here; coverage leaves these cases uncredited. +[expected_divergences] +"translation/functions/aggregate.any-value.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.json-agg-strict.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.json-object-agg-strict.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.json-object-agg-unique-strict.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.json-object-agg-unique.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.jsonb-agg-strict.toml#t001_types_1" = "aggregate_row_order" +"translation/functions/aggregate.string-agg.toml#t001_types_1" = "aggregate_row_order" diff --git a/crates/sqlbabel-policy/src/policy/_helpers/validation.rs b/crates/sqlbabel-policy/src/policy/_helpers/validation.rs index 61b86f5c7..6cbc95409 100644 --- a/crates/sqlbabel-policy/src/policy/_helpers/validation.rs +++ b/crates/sqlbabel-policy/src/policy/_helpers/validation.rs @@ -47,9 +47,20 @@ pub(crate) fn problems(policy: &Policy) -> Vec { .iter() .flat_map(|(name, divergence)| divergence_problems(name, divergence)), ); + found.extend(unknown_expected(policy)); found } +/// Every case `expected_divergences` lists with a divergence the policy does not declare. +fn unknown_expected(policy: &Policy) -> Vec { + policy + .expected_divergences + .iter() + .filter(|(_, id)| !policy.divergences.contains_key(*id)) + .map(|(case, id)| format!("expected_divergences: {case} names unknown divergence `{id}`")) + .collect() +} + fn variables(pattern: &TypePattern) -> BTreeSet<&str> { pattern .arguments diff --git a/crates/sqlbabel-policy/src/policy/models.rs b/crates/sqlbabel-policy/src/policy/models.rs index 583419ea9..780f91a6e 100644 --- a/crates/sqlbabel-policy/src/policy/models.rs +++ b/crates/sqlbabel-policy/src/policy/models.rs @@ -32,6 +32,9 @@ pub struct Policy { /// Effect statements only one engine reports an affected-row count for, by the source engine's command tag, each with why; every other count is compared. #[serde(default)] pub uncounted_statements: BTreeMap, + /// Recorded cases whose guard raises a divergence, by `#` under the cases directory, for cases whose file cannot name it; a listed case may not also declare `expected_divergence`. + #[serde(default)] + pub expected_divergences: BTreeMap, } /// The warehouse a policy's cases were recorded on, which fixes how a case's source SQL is written. diff --git a/crates/sqlbabel-policy/src/policy/tests/test_parse_policy.rs b/crates/sqlbabel-policy/src/policy/tests/test_parse_policy.rs index 113c3eb54..692220c9b 100644 --- a/crates/sqlbabel-policy/src/policy/tests/test_parse_policy.rs +++ b/crates/sqlbabel-policy/src/policy/tests/test_parse_policy.rs @@ -10,6 +10,18 @@ fn given_policy_text_when_parsing_then_schema_and_rules_are_enforced() { with: "", expected_error: None, }, + PolicyTestCase { + description: "a case listed as expecting a declared divergence", + replace: "failure = \"value\"\n", + with: "failure = \"value\"\n\n[expected_divergences]\n\"a.toml#x\" = \"hash\"\n", + expected_error: None, + }, + PolicyTestCase { + description: "a case listed as expecting a divergence the policy does not declare", + replace: "failure = \"value\"\n", + with: "failure = \"value\"\n\n[expected_divergences]\n\"a.toml#x\" = \"hsah\"\n", + expected_error: Some("expected_divergences: a.toml#x names unknown divergence `hsah`"), + }, PolicyTestCase { description: "an unknown top-level key is rejected", replace: "schema_version = 2", diff --git a/crates/sqlbabel/src/cli/_helpers/verify_command.rs b/crates/sqlbabel/src/cli/_helpers/verify_command.rs index 6099b6f1f..3a0b11dbc 100644 --- a/crates/sqlbabel/src/cli/_helpers/verify_command.rs +++ b/crates/sqlbabel/src/cli/_helpers/verify_command.rs @@ -10,6 +10,7 @@ use sqlbabel_blocks::macros::main::helper_statements::helper_statements; use sqlbabel_compare::comparison::models::RowOrder; use sqlbabel_convert::snowflake::catalogue::constants::RULES; use sqlbabel_convert::snowflake::conversion::models::ConversionOptions; +use sqlbabel_evidence::cases::main::missing_listed::missing_listed; use sqlbabel_evidence::cases::models::LoadedCase; use sqlbabel_evidence::constants::{SESSION_DEFAULTS_FILE, SESSION_DEFAULTS_NAME}; use sqlbabel_evidence::coverage::constants::COVERAGE_GAPS_LISTED; @@ -158,6 +159,17 @@ pub(crate) fn verify_command( " (reported only; --strict-errors fails on them)" }, ); + if !evidence.policy.expected_divergences.is_empty() { + let _ = writeln!( + stderr, + "sqlbabel verify: the policy declares {} divergences; {} cases expect one through its expected_divergences", + evidence.policy.divergences.len(), + evidence.policy.expected_divergences.len() + ); + for (case, divergence) in &evidence.policy.expected_divergences { + let _ = writeln!(stderr, "sqlbabel verify: {case} expects {divergence}"); + } + } let _ = writeln!( stderr, "sqlbabel verify: {}, {} cases: {} passed, {} diverged as expected, {} refused, {} typed, \ @@ -386,6 +398,10 @@ pub(crate) fn run_verification( python: Option<&Path>, ) -> Result<(Evidence, VerifyReport), String> { let evidence = load_evidence(paths)?; + let missing = missing_listed(&evidence.policy, &evidence.cases); + if !missing.is_empty() { + return Err(missing.join("; ")); + } let problems = match evidence.policy.source_dialect.is_snowflake() { true => check_equivalence_cases(&evidence.cases), false => Vec::new(), diff --git a/crates/sqlbabel/src/statements/_helpers/outcomes.rs b/crates/sqlbabel/src/statements/_helpers/outcomes.rs index 5f6db63ed..323fbb762 100644 --- a/crates/sqlbabel/src/statements/_helpers/outcomes.rs +++ b/crates/sqlbabel/src/statements/_helpers/outcomes.rs @@ -2,10 +2,12 @@ use std::collections::BTreeSet; +use sqlbabel_diagnostics::classification::models::ConstructFamily; use sqlbabel_diagnostics::diagnostics::constants::{ CODES, CONVERSION_BUDGET, DIVERGENCE_REFUSED, MISSING_RULE, NOT_EXPRESSIBLE, PARSE_FIDELITY, TYPE_CONDITION, UNRESOLVED_NAME, }; +use sqlbabel_diagnostics::provenance::models::Shape; use sqlbabel_diagnostics::refusals::models::RefusalCategory; use sqlbabel_evidence::cases::main::effect_parts::effect_parts; use sqlbabel_evidence::cases::models::{CaseRole, LoadedCase}; @@ -15,7 +17,7 @@ use sqlbabel_policy::policy::constants::HASH_DIVERGENCE; use crate::statements::_helpers::constructs::{constructs, own_functions, project_key}; use crate::statements::constants::{CATEGORIES, FUNCTION_REASON_PREFIX, UNCODED}; -use crate::statements::models::{EffectCitation, Outcome, Statement}; +use crate::statements::models::{Call, EffectCitation, Outcome, Statement}; use crate::statements::types::Judged; /// One case's statement: its outcome, codes, refused and used constructs, and an effect case's citation. @@ -38,9 +40,33 @@ pub(crate) fn case_statement( constructs: constructs(case, &own)?, microsecond_receipt: verdict.microsecond_receipt.clone(), effect: effect_citation(case), + calls: calls(verdict), }) } +/// The function calls a converted case's provenance records, each once: the shapes of `fn:` constructs. +fn calls(verdict: &CaseVerdict) -> Vec { + let prefix = format!("{}:", ConstructFamily::Function.prefix()); + let calls: BTreeSet = verdict + .provenance + .iter() + .flat_map(|provenance| provenance.shapes.values().flatten()) + .filter_map(|shape| call(shape, &prefix)) + .collect(); + calls.into_iter().collect() +} + +/// A shape of a function construct, whose key starts with `prefix`, as the call it records. +fn call(shape: &Shape, prefix: &str) -> Option { + let name = shape.construct.strip_prefix(prefix)?.to_owned(); + let arguments: Vec = shape + .arguments + .iter() + .map(|argument| argument.family.clone()) + .collect(); + Some(Call { name, arguments }) +} + /// The parts and counts an effect case's receipt must name; `None` for a query case. fn effect_citation(case: &LoadedCase) -> Option { let (effect, parts) = (case.effect.as_ref()?, effect_parts(case)?); diff --git a/crates/sqlbabel/src/statements/models.rs b/crates/sqlbabel/src/statements/models.rs index a07fb1a41..38f0a5189 100644 --- a/crates/sqlbabel/src/statements/models.rs +++ b/crates/sqlbabel/src/statements/models.rs @@ -49,6 +49,16 @@ pub struct Statement { /// An effect case's parts and counts, which its receipt must repeat; absent for a query case. #[serde(skip_serializing_if = "Option::is_none")] pub effect: Option, + /// The function calls conversion recorded, each with its arguments' types, which link a call to the form of its overload; absent when it recorded none. + #[serde(skip_serializing_if = "Vec::is_empty")] + pub calls: Vec, +} + +/// One function call as conversion recorded it: its upper-case name and its arguments' type families, in order. +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize)] +pub struct Call { + pub name: String, + pub arguments: Vec, } /// What an effect case's receipt must name: the SHA-256 of each part of the case, and how many statements and probes it has. diff --git a/crates/sqlbabel/src/statements/tests/helpers.rs b/crates/sqlbabel/src/statements/tests/helpers.rs index 66828b927..ff075c9eb 100644 --- a/crates/sqlbabel/src/statements/tests/helpers.rs +++ b/crates/sqlbabel/src/statements/tests/helpers.rs @@ -19,5 +19,6 @@ pub(crate) fn statement(reference: &str, outcome: Outcome, code: &str, key: &str constructs: Vec::new(), microsecond_receipt: None, effect: None, + calls: Vec::new(), } } diff --git a/evidence.toml b/evidence.toml index 552b62ab2..f6e3003a7 100644 --- a/evidence.toml +++ b/evidence.toml @@ -1,4 +1,4 @@ # The evidence SQLBabel's checks read: one commit of the evidence repository, and the SHA-256 of its files. repository = "https://github.com/sqlstack-io/sqlbabel-evidence.git" -commit = "7e6fdffaa6b83bb4b2025dc5ee1ba3262630b3db" -content_sha256 = "605793d7983fe62d995d777796c51a3587f12a808b24e2365e6443fe881ad826" +commit = "534640716c2b3a421b2c6c60de7b5cc2b90c52cc" +content_sha256 = "59945683050eec186279c9612bc22cb0590f8c149a92430ff4b7f08a661c3c77" diff --git a/tools/sqlbabel-coverage-check/src/cli/_helpers/results_command.rs b/tools/sqlbabel-coverage-check/src/cli/_helpers/results_command.rs index 164715112..e06272c97 100644 --- a/tools/sqlbabel-coverage-check/src/cli/_helpers/results_command.rs +++ b/tools/sqlbabel-coverage-check/src/cli/_helpers/results_command.rs @@ -126,6 +126,22 @@ fn report_lines(report: &ResultsReport) -> Vec { ), tally_line("total", &report.forms), ]; + if !report.uncredited_cases.is_empty() { + lines[0].push_str(&format!( + "; {} recorded cases uncredited, counting neither for nor against a form", + report.uncredited_cases.len() + )); + lines[3].push_str(&format!( + "; {} uncredited, each with a credited stand-in", + report.obligations.uncredited + )); + lines.extend( + report + .uncredited_cases + .iter() + .map(|(case, reason)| format!("uncredited: {case} ({})", reason.name())), + ); + } lines.extend( report .families diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/files.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/files.rs index a5f4e8df4..83a9d9999 100644 --- a/tools/sqlbabel-coverage-check/src/results/_helpers/files.rs +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/files.rs @@ -8,13 +8,15 @@ use serde::de::DeserializeOwned; use crate::formats::main::content_sha256::content_sha256; use crate::formats::main::is_utc_timestamp::is_utc_timestamp; use crate::results::_helpers::obligations::load_obligations; +use crate::results::_helpers::uncredited::cover_problems; use crate::results::constants::{ - DECLARED_REFUSAL_SUBJECT, DECLARED_REFUSALS_FILE, FORM_LINKS_SUBJECT, FUNCTION_LINKS_SUBJECT, - LINKS_FILE, NOT_TRANSLATABLE_FILE, NOT_TRANSLATABLE_SUBJECT, RESULTS_REVIEW_FILE, + ARGUMENT_TYPES_FILE, DECLARED_REFUSAL_SUBJECT, DECLARED_REFUSALS_FILE, FORM_LINKS_SUBJECT, + FUNCTION_LINKS_SUBJECT, FUNCTIONS_FAMILY, LINKS_FILE, NOT_TRANSLATABLE_FILE, + NOT_TRANSLATABLE_SUBJECT, RESULTS_REVIEW_FILE, }; use crate::results::models::{ - DeclaredRefusal, DeclaredRefusalsFile, LinksFile, NotTranslatableFile, NotTranslatableGroup, - ResultsFiles, ResultsReviewFile, TranslationObligation, + ArgumentTypesFile, DeclaredRefusal, DeclaredRefusalsFile, LinksFile, NotTranslatableFile, + NotTranslatableGroup, ResultsFiles, ResultsReviewFile, TranslationObligation, }; /// The sign-off scopes: every link read, or a sample of generated ones. @@ -203,6 +205,46 @@ fn check_review(review: &ResultsReviewFile) -> Vec { problems } +/// The forms `argument-types.toml` under `directory` lists with their first argument's type families, empty without the file, or every problem: a form that is no catalogued function, one listed twice, or one with no family. +fn load_argument_types( + directory: &Path, + families: &BTreeMap<&str, &str>, +) -> Result>, Vec> { + let path = directory.join(ARGUMENT_TYPES_FILE); + let text = match std::fs::read_to_string(&path) { + Ok(text) => text, + Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(BTreeMap::new()), + Err(error) => return Err(vec![format!("{}: {error}", path.display())]), + }; + let file: ArgumentTypesFile = parse(&path, &text).map_err(|problem| vec![problem])?; + let mut problems: Vec = Vec::new(); + let mut forms: BTreeMap> = BTreeMap::new(); + for form in file.forms { + if families.get(form.id.as_str()) != Some(&FUNCTIONS_FAMILY) { + problems.push(format!( + "argument types: {} is no catalogued function form", + form.id + )); + } + if form.first.is_empty() || form.first.iter().any(|family| family.trim().is_empty()) { + problems.push(format!( + "argument types: {} needs its first argument's families", + form.id + )); + } + if forms + .insert(form.id.clone(), form.first.into_iter().collect()) + .is_some() + { + problems.push(format!("argument types: {} is listed twice", form.id)); + } + } + match problems.is_empty() { + true => Ok(forms), + false => Err(problems), + } +} + /// The files under `directory`, cases under `cases`, or every problem; ids must be catalogued. pub(crate) fn load_files( (directory, cases): (&Path, &Path), @@ -249,8 +291,10 @@ pub(crate) fn load_files( if !problems.is_empty() { return Err(problems); } + let argument_types = load_argument_types(directory, families)?; let (obligations, retired) = load_obligations((directory, cases), families)?; - let uncited: Vec = uncited_forms(&links, &obligations); + let mut uncited: Vec = uncited_forms(&links, &obligations); + uncited.extend(cover_problems(&links, &obligations)); if !uncited.is_empty() { return Err(uncited); } @@ -262,6 +306,7 @@ pub(crate) fn load_files( links_sha256: content_sha256(links_text.as_bytes()), obligations, retired, + argument_types, }) } diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/links.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/links.rs index 07388c195..22e5fa7a5 100644 --- a/tools/sqlbabel-coverage-check/src/results/_helpers/links.rs +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/links.rs @@ -8,7 +8,7 @@ use crate::results::constants::{ CALL, CALL_BARE, CALL_NAMED, CALL_OVER, CALL_PREFIXES, FUNCTION_PREFIX, FUNCTIONS_FAMILY, STATEMENT_REFUSAL, }; -use crate::results::models::{LinksFile, RecordedStatement, StatementOutcome}; +use crate::results::models::{LinksFile, RecordedCall, RecordedStatement, StatementOutcome}; /// A function form a call links to, and the call-shape key prefix its syntax needs. pub(crate) type FunctionForm = (String, &'static str); @@ -16,6 +16,8 @@ pub(crate) type FunctionForm = (String, &'static str); /// Function forms by the upper-case name their grammar calls, and the SHA-256 of that index. pub(crate) struct FunctionIndex { pub(crate) forms: BTreeMap>, + /// The type families a form's first argument takes, for the forms `argument-types.toml` lists. + pub(crate) first: BTreeMap>, pub(crate) sha256: String, } @@ -87,8 +89,11 @@ fn keyword_arguments(call: &str) -> bool { arguments.contains(" FROM ") || arguments.contains(" IN ") } -/// Every catalogued function form under the name its grammar calls, its reading's where one parses. -pub(crate) fn function_index(coverage: &SyntaxCoverage) -> FunctionIndex { +/// Every catalogued function form under the name its grammar calls, its reading's where one parses, with the first-argument families `first` lists. +pub(crate) fn function_index( + coverage: &SyntaxCoverage, + first: &BTreeMap>, +) -> FunctionIndex { let readings: BTreeMap<&str, &str> = coverage .readings .iter() @@ -123,16 +128,38 @@ pub(crate) fn function_index(coverage: &SyntaxCoverage) -> FunctionIndex { .collect(); text.push_str(&format!("{name} {}\n", ids.join(","))); } + for (id, families) in first { + let families: Vec<&str> = families.iter().map(String::as_str).collect(); + text.push_str(&format!("first {id} {}\n", families.join(","))); + } FunctionIndex { sha256: content_sha256(text.as_bytes()), forms, + first: first.clone(), + } +} + +/// Whether the statement's `calls` of `name` fit form `id`: some call's first argument is a family the form takes, or the form lists none, or the statement records no call of `name`. +fn calls_fit(id: &str, name: &str, calls: &[RecordedCall], functions: &FunctionIndex) -> bool { + let Some(families) = functions.first.get(id) else { + return true; + }; + let mut typed = false; + let mut fits = false; + for call in calls.iter().filter(|call| call.name == name) { + typed = true; + fits |= call + .arguments + .first() + .is_some_and(|family| families.contains(family)); } + !typed || fits } -/// The forms `construct` links to in a statement using `used`, and whether anything accounts for it; a statement matching only `within_ulps` skips links that except it. +/// The forms `construct` links to in a statement using `used` and making `calls`, and whether anything accounts for it; a statement matching only `within_ulps` skips links that except it. fn construct_forms( construct: &str, - (used, within_ulps): (&BTreeSet<&str>, bool), + (used, within_ulps, calls): (&BTreeSet<&str>, bool, &[RecordedCall]), functions: &FunctionIndex, links: &LinksFile, ) -> (BTreeSet, bool) { @@ -144,7 +171,8 @@ fn construct_forms( for (id, shape) in named.into_iter().flatten() { accounted = true; let name = &construct[FUNCTION_PREFIX.len()..]; - if used.contains(format!("{shape}{name}").as_str()) { + if used.contains(format!("{shape}{name}").as_str()) && calls_fit(id, name, calls, functions) + { forms.insert(id.clone()); } } @@ -178,6 +206,7 @@ pub(crate) fn link_statement( ) -> StatementLinks { let used: BTreeSet<&str> = statement.constructs.iter().map(String::as_str).collect(); let within_ulps = statement.outcome == StatementOutcome::MatchingWithinUlps; + let calls = statement.calls.as_slice(); let mut forms: BTreeSet = BTreeSet::new(); let mut unaccounted: Vec = Vec::new(); for construct in &statement.constructs { @@ -188,7 +217,7 @@ pub(crate) fn link_statement( continue; } let (linked, accounted) = - construct_forms(construct, (&used, within_ulps), functions, links); + construct_forms(construct, (&used, within_ulps, calls), functions, links); forms.extend(linked); if !accounted { unaccounted.push(construct.clone()); @@ -200,7 +229,15 @@ pub(crate) fn link_statement( for key in &statement.refused { let mut met_with_refused = used.clone(); met_with_refused.insert(key.as_str()); - named.extend(construct_forms(key, (&met_with_refused, within_ulps), functions, links).0); + named.extend( + construct_forms( + key, + (&met_with_refused, within_ulps, calls), + functions, + links, + ) + .0, + ); } let whole_refusal = whole || named.is_empty(); let refused_forms: BTreeSet = match whole_refusal { diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/mod.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/mod.rs index 93a2ec27e..9d3b14b3d 100644 --- a/tools/sqlbabel-coverage-check/src/results/_helpers/mod.rs +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/mod.rs @@ -4,4 +4,5 @@ pub(crate) mod forms; pub(crate) mod links; pub(crate) mod obligations; pub(crate) mod report; +pub(crate) mod uncredited; pub(crate) mod worklist; diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/obligations.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/obligations.rs index 84ee11668..296889a56 100644 --- a/tools/sqlbabel-coverage-check/src/results/_helpers/obligations.rs +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/obligations.rs @@ -3,6 +3,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; +use crate::results::_helpers::uncredited::uncredited_cases; use crate::results::constants::{ BOUNDARY_SUBKINDS, OBLIGATION_CASES_PREFIX, OBLIGATION_FILE_EXTENSION, OBLIGATIONS_DIR, RELATIVE_PATH_PARTS, RETIRED_OBLIGATIONS_FILE, TRANSLATION_CASES, @@ -255,7 +256,7 @@ fn obligation_problems( problems } -/// Each obligation's state; a cited case no statement records is a problem. A case matching only within ULPs meets no obligation of a form whose link excepts such matches, as it counts neither for nor against that form. +/// Each obligation's state, judged on its credited cases, uncredited when it has none; a cited case no statement records is a problem. A case matching only within ULPs meets no obligation of a form whose link excepts such matches, as it counts neither for nor against that form. pub(crate) fn obligation_states( obligations: &[TranslationObligation], statements: &[RecordedStatement], @@ -273,11 +274,24 @@ pub(crate) fn obligation_states( .collect(); let mut problems: Vec = Vec::new(); let mut states: BTreeMap = BTreeMap::new(); + let uncredited = uncredited_cases(links); for obligation in obligations { let exact_only = exact.contains(obligation.form.as_str()); - let mut met = !obligation.cases.is_empty(); - for case in &obligation.cases { - let reference = case.strip_prefix(OBLIGATION_CASES_PREFIX).unwrap_or(case); + let references: Vec<&str> = obligation + .cases + .iter() + .map(|case| case.strip_prefix(OBLIGATION_CASES_PREFIX).unwrap_or(case)) + .collect(); + let credited: Vec<&str> = references + .iter() + .copied() + .filter(|reference| !uncredited.contains_key(reference)) + .collect(); + let mut met = !credited.is_empty(); + for (case, reference) in obligation.cases.iter().zip(&references) { + if !credited.contains(reference) { + continue; + } match outcomes.get(reference) { Some(outcome) => { met &= outcome.matches() @@ -289,9 +303,11 @@ pub(crate) fn obligation_states( )), } } + let all_uncredited = credited.is_empty() && !references.is_empty(); let state = match (obligation.required, obligation.held.is_some(), met) { (false, _, _) => ObligationState::Unmeasured, (true, true, _) => ObligationState::Held, + (true, false, _) if all_uncredited => ObligationState::Uncredited, (true, false, true) => ObligationState::Met, (true, false, false) => ObligationState::Unmet, }; diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/report.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/report.rs index 03e9d2d97..80eacd69f 100644 --- a/tools/sqlbabel-coverage-check/src/results/_helpers/report.rs +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/report.rs @@ -9,6 +9,7 @@ use crate::results::_helpers::files::{ use crate::results::_helpers::forms::{family_tallies, form_result, statement_tally}; use crate::results::_helpers::links::{FunctionIndex, link_statement}; use crate::results::_helpers::obligations::uncited_cases; +use crate::results::_helpers::uncredited::uncredited_cases; use crate::results::_helpers::worklist::worklist; use crate::results::constants::{ DECLARED_REFUSAL_SUBJECT, DIVERGENCE_CODE_PREFIX, NOT_TRANSLATABLE_SUBJECT, @@ -103,13 +104,14 @@ fn cited_cases(files: &ResultsFiles) -> BTreeMap<&str, BTreeSet> { cases } -/// The forms each statement counts for: a refused one only for the forms its refusal names, and a cited case also for the cited forms its obligations name unless its refusal names other forms. +/// The forms each statement counts for: an uncredited one none, a refused one only for the forms its refusal names, and a cited case also for the cited forms its obligations name unless its refusal names other forms. pub(crate) fn link_all<'a>( statements: &'a [RecordedStatement], functions: &FunctionIndex, files: &ResultsFiles, ) -> Result, Vec> { let cited = cited_cases(files); + let uncredited = uncredited_cases(&files.links); let mut links: Links = BTreeMap::new(); let mut unaccounted: BTreeMap> = BTreeMap::new(); for statement in statements { @@ -125,7 +127,9 @@ pub(crate) fn link_all<'a>( true => linked.refused_forms, false => linked.forms, }; - if !refused || linked.whole_refusal { + if uncredited.contains_key(statement.reference.as_str()) { + forms.clear(); + } else if !refused || linked.whole_refusal { forms.extend( cited .get(statement.reference.as_str()) @@ -172,7 +176,10 @@ pub(crate) fn form_results( .filter(|obligation| obligation.required) { declared.insert(obligation.form.as_str()); - if states.get(&obligation.id) != Some(&ObligationState::Met) { + if !matches!( + states.get(&obligation.id), + Some(ObligationState::Met | ObligationState::Uncredited) + ) { unmet .entry(obligation.form.as_str()) .or_default() @@ -271,11 +278,13 @@ pub(crate) fn assemble( ObligationState::Unmet => &mut obligations.unmet, ObligationState::Held => &mut obligations.held, ObligationState::Unmeasured => &mut obligations.unmeasured, + ObligationState::Uncredited => &mut obligations.uncredited, } += 1; } + let uncredited = uncredited_cases(&files.links); let with_forms: BTreeSet<&str> = links .iter() - .filter(|(_, forms)| !forms.is_empty()) + .filter(|(reference, forms)| !forms.is_empty() || uncredited.contains_key(*reference)) .map(|(reference, _)| *reference) .collect(); let subjects: Vec<(String, bool)> = subjects(files, &functions.sha256); @@ -286,7 +295,8 @@ pub(crate) fn assemble( .map(|(subject, _)| subject.clone()) .collect() }; - let (forms, families) = family_tallies(&form_results); + let (mut forms, families) = family_tallies(&form_results); + forms.uncredited_cases = uncredited.len(); let (capture_forms, effect_receipt_forms) = needing_forms(&form_results); ResultsReport { forms, @@ -318,6 +328,10 @@ pub(crate) fn assemble( uncited_cases: uncited_cases(&files.obligations, statements), retired_obligations: files.retired.clone(), obligation_states, + uncredited_cases: uncredited + .into_iter() + .map(|(case, reason)| (case.to_owned(), reason)) + .collect(), } } diff --git a/tools/sqlbabel-coverage-check/src/results/_helpers/uncredited.rs b/tools/sqlbabel-coverage-check/src/results/_helpers/uncredited.rs new file mode 100644 index 000000000..bb1c4761e --- /dev/null +++ b/tools/sqlbabel-coverage-check/src/results/_helpers/uncredited.rs @@ -0,0 +1,138 @@ +//! Cases the links file leaves uncredited: each must be recorded and diverge as its reason expects, and its obligation must have a credited stand-in. + +use std::collections::{BTreeMap, BTreeSet}; + +use crate::results::constants::{ + DIVERGENCE_CODE_PREFIX, OBLIGATION_CASES_PREFIX, ROW_ORDER_DIVERGENCES, TRANSLATION_CASES, +}; +use crate::results::models::{ + LinksFile, RecordedStatement, StatementOutcome, TranslationObligation, UncreditedReason, +}; + +/// Each uncredited case's statement reference and its reason. +pub(crate) fn uncredited_cases(links: &LinksFile) -> BTreeMap<&str, UncreditedReason> { + let mut cases: BTreeMap<&str, UncreditedReason> = BTreeMap::new(); + for group in &links.uncredited { + for case in &group.cases { + cases.insert(case, group.reason); + } + } + cases +} + +/// Whether a count is zero, so a report without uncredited obligations does not name them. +pub(crate) fn is_none(count: &usize) -> bool { + *count == 0 +} + +/// The divergences whose raise shows a case's result depends on what `reason` names. +fn divergences(reason: UncreditedReason) -> &'static [&'static str] { + match reason { + UncreditedReason::UnspecifiedRowOrder => &ROW_ORDER_DIVERGENCES, + } +} + +/// An obligation's cited cases as statement references. +fn references(obligation: &TranslationObligation) -> impl Iterator { + obligation + .cases + .iter() + .map(|case| case.strip_prefix(OBLIGATION_CASES_PREFIX).unwrap_or(case)) +} + +/// Whether `obligation` cites the statement `case`. +fn cites(obligation: &TranslationObligation, case: &str) -> bool { + references(obligation).any(|cited| cited == case) +} + +/// Every problem with the uncredited cases that the files alone show: a malformed or repeated case, one no required obligation cites, or one whose obligation no obligation of the same form and kind with only credited cases stands in for. +pub(crate) fn cover_problems( + links: &LinksFile, + obligations: &[TranslationObligation], +) -> Vec { + let mut problems: Vec = Vec::new(); + let mut seen: BTreeSet<&str> = BTreeSet::new(); + for group in &links.uncredited { + if group.cases.is_empty() { + problems.push("uncredited: needs cases".to_owned()); + } + for case in &group.cases { + if !case.starts_with(TRANSLATION_CASES) || !case.contains(".toml#") { + problems.push(format!( + "uncredited: {case} is not {TRANSLATION_CASES}/.toml#" + )); + } + if !seen.insert(case) { + problems.push(format!("uncredited: {case} listed twice")); + } + } + } + let required: Vec<&TranslationObligation> = obligations + .iter() + .filter(|obligation| obligation.required) + .collect(); + let credited = |obligation: &TranslationObligation| { + !obligation.cases.is_empty() && references(obligation).all(|case| !seen.contains(case)) + }; + for case in &seen { + let citing: Vec<&&TranslationObligation> = required + .iter() + .filter(|obligation| cites(obligation, case)) + .collect(); + if citing.is_empty() { + problems.push(format!( + "uncredited: {case} is cited by no required obligation" + )); + } + for obligation in citing { + let stand_in = required.iter().any(|other| { + credited(other) + && other.form == obligation.form + && other.kind == obligation.kind + && other.subkind == obligation.subkind + }); + if !stand_in { + problems.push(format!( + "uncredited: {case} leaves obligation {} with no {:?} obligation of {} \ + citing only credited cases", + obligation.id, obligation.kind, obligation.form + )); + } + } + } + problems +} + +/// Every uncredited case that no statement records, or whose statement does not raise a divergence its reason names. +pub(crate) fn record_problems(links: &LinksFile, statements: &[RecordedStatement]) -> Vec { + let recorded: BTreeMap<&str, &RecordedStatement> = statements + .iter() + .map(|statement| (statement.reference.as_str(), statement)) + .collect(); + let mut problems: Vec = Vec::new(); + for (case, reason) in uncredited_cases(links) { + let Some(statement) = recorded + .get(case) + .filter(|statement| statement.outcome.recorded()) + else { + problems.push(format!( + "uncredited: no recorded statement is the case {case}" + )); + continue; + }; + let codes: Vec = divergences(reason) + .iter() + .map(|divergence| format!("{DIVERGENCE_CODE_PREFIX}{divergence}")) + .collect(); + let diverges = statement.outcome == StatementOutcome::DeclaredDivergence + && statement.codes.iter().any(|code| codes.contains(code)); + if !diverges { + problems.push(format!( + "uncredited: {case} is {:?}, not a declared divergence of {}", + statement.outcome, + divergences(reason).join(" or ") + )); + } + } + problems +} diff --git a/tools/sqlbabel-coverage-check/src/results/constants.rs b/tools/sqlbabel-coverage-check/src/results/constants.rs index 03f89316a..332b3d702 100644 --- a/tools/sqlbabel-coverage-check/src/results/constants.rs +++ b/tools/sqlbabel-coverage-check/src/results/constants.rs @@ -8,6 +8,8 @@ pub const BASELINE_FORMAT: &str = "sqlbabel-translation-results/1"; pub const LINKS_FILE: &str = "form-links.toml"; /// Forms DuckDB has no meaningful equivalent for, with their reasons. pub const NOT_TRANSLATABLE_FILE: &str = "not-translatable.toml"; +/// The type families of the first argument of function forms that share a name, in the translation directory; optional. +pub const ARGUMENT_TYPES_FILE: &str = "argument-types.toml"; /// The reviewers' sign-offs of the links and the list. pub const RESULTS_REVIEW_FILE: &str = "reviews/results.toml"; /// The committed outcomes the gate compares with. @@ -78,3 +80,5 @@ pub const MICROSECOND_RECEIPT_DIRS: [&str; 2] = ["microseconds/results", "micros pub const EFFECT_RESULTS_DIR: &str = "results"; /// The phases a probe is read in, which name its Arrow files `.p..arrow`. pub const PROBE_PHASES: [&str; 2] = ["before", "after"]; +/// The declared divergences whose raise shows a result depends on a row order the source engine leaves unspecified. +pub const ROW_ORDER_DIVERGENCES: [&str; 1] = ["aggregate_row_order"]; diff --git a/tools/sqlbabel-coverage-check/src/results/main/measure_results.rs b/tools/sqlbabel-coverage-check/src/results/main/measure_results.rs index 0b96c405e..d3e666e41 100644 --- a/tools/sqlbabel-coverage-check/src/results/main/measure_results.rs +++ b/tools/sqlbabel-coverage-check/src/results/main/measure_results.rs @@ -4,10 +4,11 @@ use crate::formats::models::SyntaxCoverage; use crate::results::_helpers::links::function_index; use crate::results::_helpers::obligations::obligation_states; use crate::results::_helpers::report::{assemble, form_results, link_all}; +use crate::results::_helpers::uncredited::record_problems; use crate::results::constants::STATEMENTS_FORMAT; use crate::results::models::{ResultsFiles, ResultsReport, StatementsFile}; -/// The report, or every problem: a wrong format, unmapped constructs, or a listed form matching. +/// The report, or every problem: a wrong format, an uncredited case not diverging as listed, unmapped constructs, or a listed form matching. pub fn measure_results( coverage: &SyntaxCoverage, files: &ResultsFiles, @@ -20,7 +21,11 @@ pub fn measure_results( )]); } let statements = statements.statements.as_slice(); - let functions = function_index(coverage); + let uncredited = record_problems(&files.links, statements); + if !uncredited.is_empty() { + return Err(uncredited); + } + let functions = function_index(coverage, &files.argument_types); let links = link_all(statements, &functions, files)?; let states = obligation_states(&files.obligations, statements, &files.links)?; let results = form_results(coverage, files, (statements, &links), &states)?; diff --git a/tools/sqlbabel-coverage-check/src/results/models.rs b/tools/sqlbabel-coverage-check/src/results/models.rs index be8d949c5..e9f6ad8ec 100644 --- a/tools/sqlbabel-coverage-check/src/results/models.rs +++ b/tools/sqlbabel-coverage-check/src/results/models.rs @@ -34,6 +34,17 @@ pub struct RecordedStatement { /// An effect case's parts and counts, which its receipt must repeat; absent for a query statement, which credits no effect form. #[serde(default, skip_serializing_if = "Option::is_none")] pub effect: Option, + /// The function calls conversion recorded with their arguments' type families; absent where the converter records none. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub calls: Vec, +} + +/// One function call a statement makes: its upper-case name and its arguments' type families, in order. +#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[serde(deny_unknown_fields)] +pub struct RecordedCall { + pub name: String, + pub arguments: Vec, } /// What an effect statement's receipt must name: the SHA-256 of each part of its case, and how many statements and probes the case has. @@ -132,6 +143,34 @@ pub struct LinksFile { pub no_forms: Vec, #[serde(default)] pub cited_forms: Vec, + #[serde(default, rename = "uncredited")] + pub uncredited: Vec, +} + +/// Recorded cases that count neither for nor against any form, for a reason the checker knows. +#[derive(Clone, Debug, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct UncreditedCases { + /// Statement references, `translation//.toml#`. + pub cases: Vec, + pub reason: UncreditedReason, +} + +/// Why a case may go uncredited; a new reason needs a change to the checker. +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] +#[serde(rename_all = "snake_case")] +pub enum UncreditedReason { + /// The recorded result depends on a row order the source engine leaves unspecified. + UnspecifiedRowOrder, +} + +impl UncreditedReason { + /// The reason as the links file spells it. + pub fn name(self) -> &'static str { + match self { + Self::UnspecifiedRowOrder => "unspecified_row_order", + } + } } /// A statement using every one of `constructs` exercises each of `forms`. @@ -303,6 +342,8 @@ pub enum ObligationState { Held, /// Not required: a documented alternative no case can measure, with its reason. Unmeasured, + /// Required, and every cited case is uncredited; an obligation of its form and kind with credited cases stands in for it. + Uncredited, } /// Obligation counts by state. @@ -313,6 +354,8 @@ pub struct ObligationTally { pub unmet: usize, pub held: usize, pub unmeasured: usize, + #[serde(skip_serializing_if = "crate::results::_helpers::uncredited::is_none")] + pub uncredited: usize, } /// The loaded link and list files, checked against the catalogue. @@ -328,6 +371,24 @@ pub struct ResultsFiles { pub obligations: Vec, /// The ids `retired-obligations.toml` withdraws. pub retired: BTreeSet, + /// Each form `argument-types.toml` lists, with the type families its first argument takes; empty without the file. + pub argument_types: BTreeMap>, +} + +/// `argument-types.toml`: for function names several forms share, the type families each form's first argument takes, so a typed call links only to its own forms. +#[derive(Clone, Debug, Default, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct ArgumentTypesFile { + #[serde(default, rename = "form")] + pub forms: Vec, +} + +/// One form and the type families of its first argument, as the dialect's converter names them. +#[derive(Clone, Debug, Deserialize)] +#[serde(deny_unknown_fields)] +pub struct ArgumentTypes { + pub id: String, + pub first: Vec, } /// A form's state over the recorded statements linked to it. @@ -376,6 +437,9 @@ pub struct FormResult { #[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)] pub struct FormTally { pub catalogued: usize, + /// Recorded cases the links file leaves uncredited, beside the matching count; whole catalogue only. + #[serde(skip_serializing_if = "crate::results::_helpers::uncredited::is_none")] + pub uncredited_cases: usize, pub not_translatable: usize, /// Catalogued less signed-off not-translatable: the form figure's denominator. pub translatable: usize, @@ -453,6 +517,9 @@ pub struct ResultsReport { pub uncited_cases: Vec, /// The obligation ids withdrawn in `retired-obligations.toml`. pub retired_obligations: BTreeSet, + /// Each case the links file leaves uncredited, with its reason. + #[serde(skip_serializing_if = "BTreeMap::is_empty")] + pub uncredited_cases: BTreeMap, } /// `results-baseline.json`: every statement's outcome and every form's state. diff --git a/tools/sqlbabel-coverage-check/src/results/tests.rs b/tools/sqlbabel-coverage-check/src/results/tests.rs index 86bea51a4..2c59c7457 100644 --- a/tools/sqlbabel-coverage-check/src/results/tests.rs +++ b/tools/sqlbabel-coverage-check/src/results/tests.rs @@ -10,3 +10,5 @@ mod test_measure_results; mod test_obligations; #[path = "tests/test_types.rs"] mod test_types; +#[path = "tests/test_uncredited.rs"] +mod test_uncredited; diff --git a/tools/sqlbabel-coverage-check/src/results/tests/helpers.rs b/tools/sqlbabel-coverage-check/src/results/tests/helpers.rs index e309995a7..3e10ce947 100644 --- a/tools/sqlbabel-coverage-check/src/results/tests/helpers.rs +++ b/tools/sqlbabel-coverage-check/src/results/tests/helpers.rs @@ -16,7 +16,7 @@ use crate::results::main::load_results_files::load_results_files; use crate::results::main::measure_results::measure_results; use crate::results::main::microsecond_receipt_problems::microsecond_receipt_problems; use crate::results::models::{ - EffectCitation, RecordedStatement, ResultState, ResultsBaseline, ResultsReport, + EffectCitation, RecordedCall, RecordedStatement, ResultState, ResultsBaseline, ResultsReport, StatementOutcome, StatementsFile, }; @@ -108,6 +108,7 @@ pub(crate) fn statement( constructs: with_call_shapes(constructs), microsecond_receipt: None, effect: None, + calls: Vec::new(), } } @@ -157,6 +158,75 @@ pub(crate) fn measure( ) } +/// The `LENGTH` forms a typed call tells apart: text and geometry. +pub(crate) const LENGTH_FORMS: [(&str, &str); 2] = [ + ("sf.functions.length", "LENGTH( )"), + ("sf.functions.length-geometry", "LENGTH( )"), +]; + +/// The `LENGTH` forms a matching statement making `calls` credits, given `argument_types` as `argument-types.toml`'s text, or the problems loading it. +pub(crate) fn typed_credits( + calls: &[(&str, &[&str])], + argument_types: &str, +) -> Result, Vec> { + let directory = tempfile::tempdir().expect("directory"); + let root = tree(directory.path()); + let catalogue = root.join("catalogue/functions.toml"); + let forms: String = LENGTH_FORMS + .iter() + .map(|(id, grammar)| call_form(id, grammar)) + .collect(); + let text = std::fs::read_to_string(&catalogue).expect("catalogue"); + std::fs::write(&catalogue, format!("{text}{forms}")).expect("catalogue written"); + let translation = directory.path().join("translation"); + for (name, text) in [ + ("form-links.toml", LINKS), + ("not-translatable.toml", ""), + ("reviews/results.toml", ""), + ("obligations/functions.toml", ""), + ("argument-types.toml", argument_types), + ] { + write(&translation, name, text); + } + std::fs::create_dir_all(directory.path().join("cases")).expect("cases root"); + let coverage = load_coverage(&root, None).expect("coverage loads"); + let files = load_results_files((&translation, &directory.path().join("cases")), &coverage)?; + let statement = RecordedStatement { + calls: calls + .iter() + .map(|(name, arguments)| RecordedCall { + name: (*name).to_owned(), + arguments: arguments + .iter() + .map(|family| (*family).to_owned()) + .collect(), + }) + .collect(), + ..statement("f.toml#c", StatementOutcome::Matching, &["fn:LENGTH"]) + }; + let report = measure_results( + &coverage, + &files, + &StatementsFile { + format: STATEMENTS_FORMAT.to_owned(), + statements: vec![statement], + }, + )?; + Ok(LENGTH_FORMS + .iter() + .map(|(id, _)| *id) + .filter(|id| credited(&report, id)) + .collect()) +} + +/// Whether a statement links to the form `id` in `report`. +fn credited(report: &ResultsReport, id: &str) -> bool { + report + .form_results + .iter() + .any(|form| form.id == id && form.statements > 0) +} + /// No translation file text, for a fixture that writes none. pub(crate) fn nothing(_: &str) -> String { String::new() @@ -579,3 +649,14 @@ pub(crate) fn dml_form_statements(effect: bool, obligations: &str) -> usize { .expect("the DML form is measured") .statements } + +/// The statement `reference` with `outcome` and the diagnostic `codes` verify gave it. +pub(crate) fn coded( + reference: &str, + (outcome, codes): (StatementOutcome, &[&str]), +) -> RecordedStatement { + RecordedStatement { + codes: codes.iter().map(|code| (*code).to_owned()).collect(), + ..statement(reference, outcome, &["fn:COUNT_IF"]) + } +} diff --git a/tools/sqlbabel-coverage-check/src/results/tests/test_measure_results.rs b/tools/sqlbabel-coverage-check/src/results/tests/test_measure_results.rs index 58bb9f7ca..318e1f1ca 100644 --- a/tools/sqlbabel-coverage-check/src/results/tests/test_measure_results.rs +++ b/tools/sqlbabel-coverage-check/src/results/tests/test_measure_results.rs @@ -1,14 +1,18 @@ use crate::results::models::{ResultState, StatementOutcome}; use crate::results::tests::helpers::receipt_problems; use crate::results::tests::helpers::{ - LINKS, SHAPE_FORMS, form_state, list, list_signoff, measure, nothing, statement, + LINKS, SHAPE_FORMS, form_state, list, list_signoff, measure, nothing, statement, typed_credits, }; use crate::results::tests::test_types::MicrosecondReceiptTestCase; use crate::results::tests::test_types::{ CallShapeTestCase, FormStateTestCase, LinkTestCase, ListedMatchTestCase, RefusalTestCase, - RefusedConstructTestCase, WithinUlpsLinkTestCase, + RefusedConstructTestCase, TypedCallTestCase, WithinUlpsLinkTestCase, }; +/// Text calls go to `sf.functions.length`, geometry ones to `sf.functions.length-geometry`. +const LENGTH_TYPES: &str = "[[form]]\nid = \"sf.functions.length\"\nfirst = [\"TEXT\", \"VARCHAR\"]\n\n\ + [[form]]\nid = \"sf.functions.length-geometry\"\nfirst = [\"LSEG\"]\n"; + const COUNT_IF: &str = "sf.functions.count-if"; const IFF: &str = "sf.functions.iff"; const SELECT: &str = "sf.query.select"; @@ -627,3 +631,77 @@ fn given_a_statement_judged_on_a_microsecond_re_recording_when_measuring_then_bo ); } } + +#[test] +fn given_typed_calls_when_measuring_then_each_call_credits_only_the_forms_its_first_argument_fits() +{ + let test_cases = [ + TypedCallTestCase { + description: "a text call credits the text form, not the geometry form of the same name", + calls: &[("LENGTH", &["TEXT"])], + argument_types: LENGTH_TYPES, + expected_forms: Ok(&["sf.functions.length"]), + }, + TypedCallTestCase { + description: "a geometry call credits only the geometry form", + calls: &[("LENGTH", &["LSEG"])], + argument_types: LENGTH_TYPES, + expected_forms: Ok(&["sf.functions.length-geometry"]), + }, + TypedCallTestCase { + description: "a text and a geometry call credit both forms", + calls: &[("LENGTH", &["VARCHAR"]), ("LENGTH", &["LSEG"])], + argument_types: LENGTH_TYPES, + expected_forms: Ok(&["sf.functions.length", "sf.functions.length-geometry"]), + }, + TypedCallTestCase { + description: "a call of a family no form lists credits neither", + calls: &[("LENGTH", &["INT4"])], + argument_types: LENGTH_TYPES, + expected_forms: Ok(&[]), + }, + TypedCallTestCase { + description: "a statement recording no LENGTH call links by name, as before", + calls: &[("UPPER", &["TEXT"])], + argument_types: LENGTH_TYPES, + expected_forms: Ok(&["sf.functions.length", "sf.functions.length-geometry"]), + }, + TypedCallTestCase { + description: "without argument types, a typed call links by name, as before", + calls: &[("LENGTH", &["TEXT"])], + argument_types: "", + expected_forms: Ok(&["sf.functions.length", "sf.functions.length-geometry"]), + }, + TypedCallTestCase { + description: "a form the file does not list links by name beside a listed one", + calls: &[("LENGTH", &["TEXT"])], + argument_types: "[[form]]\nid = \"sf.functions.length-geometry\"\nfirst = [\"LSEG\"]\n", + expected_forms: Ok(&["sf.functions.length"]), + }, + TypedCallTestCase { + description: "argument types of an uncatalogued form", + calls: &[], + argument_types: "[[form]]\nid = \"sf.functions.lenght\"\nfirst = [\"TEXT\"]\n", + expected_forms: Err("sf.functions.lenght is no catalogued function form"), + }, + TypedCallTestCase { + description: "a form listed with no family", + calls: &[], + argument_types: "[[form]]\nid = \"sf.functions.length\"\nfirst = []\n", + expected_forms: Err("sf.functions.length needs its first argument's families"), + }, + ]; + + for test_case in test_cases { + let credited = typed_credits(test_case.calls, test_case.argument_types); + + assert_eq!( + credited.as_deref().map_err(|problems| problems.join("\n")), + test_case + .expected_forms + .map_err(|problem| format!("argument types: {problem}")), + "{}", + test_case.description + ); + } +} diff --git a/tools/sqlbabel-coverage-check/src/results/tests/test_types.rs b/tools/sqlbabel-coverage-check/src/results/tests/test_types.rs index 2e0fbfc5a..7577847d0 100644 --- a/tools/sqlbabel-coverage-check/src/results/tests/test_types.rs +++ b/tools/sqlbabel-coverage-check/src/results/tests/test_types.rs @@ -88,6 +88,14 @@ pub(crate) struct DiffTestCase { pub(crate) expected_regression: bool, } +/// A matching `LENGTH` statement's calls and argument types, and the forms it credits or the problem. +pub(crate) struct TypedCallTestCase { + pub(crate) description: &'static str, + pub(crate) calls: &'static [(&'static str, &'static [&'static str])], + pub(crate) argument_types: &'static str, + pub(crate) expected_forms: Result<&'static [&'static str], &'static str>, +} + /// The keys of one statement calling SUM, REGR_SYY, EXTRACT or CURRENT_DATE, and the forms it credits. pub(crate) struct CallShapeTestCase { pub(crate) description: &'static str, @@ -195,3 +203,29 @@ pub(crate) struct EffectFormTestCase { pub(crate) obligations: &'static str, pub(crate) expected_statements: usize, } + +/// An `[[uncredited]]` section over COUNT_IF's cases t001 and t009, their outcomes, and the form's state or the problem. +pub(crate) struct UncreditedTestCase { + pub(crate) description: &'static str, + /// The `[[uncredited]]` sections appended to the fixture links. + pub(crate) uncredited: &'static str, + pub(crate) obligations: String, + /// The outcome of t001, which the section lists, and its codes. + pub(crate) listed: (StatementOutcome, &'static [&'static str]), + /// The outcome of t009, the case an obligation of the same kind may cite as a stand-in. + pub(crate) stand_in: StatementOutcome, + /// The form's state, or none when loading or measuring fails. + pub(crate) expected_state: Option, + /// The uncredited cases and uncredited obligations the report counts. + pub(crate) expected_uncredited: (usize, usize), + /// Text the problems hold, empty when there are none. + pub(crate) expected_problem: &'static str, +} + +/// COUNT_IF's listed case t001 recorded twice, in order, and the problem the measure reports. +pub(crate) struct RepeatedUncreditedTestCase { + pub(crate) description: &'static str, + /// The outcomes and codes of t001's two statements, in the order the statements file lists them. + pub(crate) recorded: [(StatementOutcome, &'static [&'static str]); 2], + pub(crate) expected_problem: &'static str, +} diff --git a/tools/sqlbabel-coverage-check/src/results/tests/test_uncredited.rs b/tools/sqlbabel-coverage-check/src/results/tests/test_uncredited.rs new file mode 100644 index 000000000..6fc989496 --- /dev/null +++ b/tools/sqlbabel-coverage-check/src/results/tests/test_uncredited.rs @@ -0,0 +1,239 @@ +use crate::results::models::{ResultState, StatementOutcome}; +use crate::results::tests::helpers::{ + COUNT_IF_CASE, LINKS, citing, coded, measure_linked, obligation, +}; +use crate::results::tests::test_types::{RepeatedUncreditedTestCase, UncreditedTestCase}; + +/// COUNT_IF's other case, which a second obligation cites as the stand-in. +const STAND_IN: &str = "translation/functions/count-if.toml#t009"; +/// The section leaving COUNT_IF's case t001 uncredited for its row order. +const ROW_ORDER: &str = "[[uncredited]]\ncases = [\"translation/functions/count-if.toml#t001\"]\nreason = \"unspecified_row_order\"\n"; +/// The codes of a statement whose row-order guard raised. +const ROW_ORDER_RAISED: &[&str] = &["divergence:aggregate_row_order"]; + +#[test] +fn given_uncredited_cases_when_measuring_then_they_count_for_no_form_and_never_hide_a_gap() { + let both = obligation(1, &citing(COUNT_IF_CASE)) + &obligation(2, &citing(STAND_IN)); + let diverging = (StatementOutcome::DeclaredDivergence, ROW_ORDER_RAISED); + let test_cases = [ + UncreditedTestCase { + description: "a diverging case beside a matching stand-in: the form matches on the stand-in", + uncredited: ROW_ORDER, + obligations: both.clone(), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: Some(ResultState::Matching), + expected_uncredited: (1, 1), + expected_problem: "", + }, + UncreditedTestCase { + description: "a diverging case beside a refused stand-in: exclusion alone matches nothing", + uncredited: ROW_ORDER, + obligations: both.clone(), + listed: diverging, + stand_in: StatementOutcome::Refused, + expected_state: Some(ResultState::Refused), + expected_uncredited: (1, 1), + expected_problem: "", + }, + UncreditedTestCase { + description: "a reason the checker does not know", + uncredited: "[[uncredited]]\ncases = [\"translation/functions/count-if.toml#t001\"]\nreason = \"depends on row order\"\n", + obligations: both.clone(), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "unknown variant", + }, + UncreditedTestCase { + description: "no other obligation of the form stands in for the uncredited one", + uncredited: ROW_ORDER, + obligations: obligation(1, &citing(COUNT_IF_CASE)), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "with no TypeCombination obligation of sf.functions.count-if", + }, + UncreditedTestCase { + description: "the only other obligation is of another kind", + uncredited: ROW_ORDER, + obligations: obligation(1, &citing(COUNT_IF_CASE)) + + &obligation(2, &citing(STAND_IN)).replace("type_combination", "null_argument"), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "with no TypeCombination obligation of sf.functions.count-if", + }, + UncreditedTestCase { + description: "the only other obligation is a boundary of another subkind", + uncredited: ROW_ORDER, + obligations: obligation(1, &citing(COUNT_IF_CASE)) + .replace("type_combination\"", "boundary\"\nsubkind = \"overflow\"") + + &obligation(2, &citing(STAND_IN)) + .replace("type_combination\"", "boundary\"\nsubkind = \"magnitude\""), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "with no Boundary obligation of sf.functions.count-if", + }, + UncreditedTestCase { + description: "the stand-in's only obligation also cites the uncredited case", + uncredited: ROW_ORDER, + obligations: obligation(1, &citing(COUNT_IF_CASE)) + + &obligation( + 2, + &format!( + "cases = [\"cases/{COUNT_IF_CASE}\", \"cases/{STAND_IN}\"]\nrequired = true" + ), + ), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "citing only credited cases", + }, + UncreditedTestCase { + description: "a listed case no required obligation cites", + uncredited: "[[uncredited]]\ncases = [\"translation/functions/count-if.toml#t005\"]\nreason = \"unspecified_row_order\"\n", + obligations: both.clone(), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "count-if.toml#t005 is cited by no required obligation", + }, + UncreditedTestCase { + description: "a case listed twice", + uncredited: "[[uncredited]]\ncases = [\"translation/functions/count-if.toml#t001\", \"translation/functions/count-if.toml#t001\"]\nreason = \"unspecified_row_order\"\n", + obligations: both.clone(), + listed: diverging, + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "listed twice", + }, + UncreditedTestCase { + description: "the listed case has no recorded result", + uncredited: ROW_ORDER, + obligations: both.clone(), + listed: (StatementOutcome::UnrecordedRefused, ROW_ORDER_RAISED), + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "no recorded statement is the case translation/functions/count-if.toml#t001", + }, + UncreditedTestCase { + description: "the listed case matches instead of diverging", + uncredited: ROW_ORDER, + obligations: both.clone(), + listed: (StatementOutcome::Matching, &[]), + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "is Matching, not a declared divergence of aggregate_row_order", + }, + UncreditedTestCase { + description: "the listed case is refused outright", + uncredited: ROW_ORDER, + obligations: both.clone(), + listed: (StatementOutcome::Refused, &["SBL0002"]), + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "is Refused, not a declared divergence", + }, + UncreditedTestCase { + description: "the listed case diverges for another reason", + uncredited: ROW_ORDER, + obligations: both, + listed: ( + StatementOutcome::DeclaredDivergence, + &["divergence:window_row_order"], + ), + stand_in: StatementOutcome::Matching, + expected_state: None, + expected_uncredited: (0, 0), + expected_problem: "is DeclaredDivergence, not a declared divergence of aggregate_row_order", + }, + ]; + for test_case in test_cases { + let measured = measure_linked( + vec![ + coded(COUNT_IF_CASE, test_case.listed), + coded(STAND_IN, (test_case.stand_in, &["SBL0003"])), + ], + &format!("{LINKS}{}", test_case.uncredited), + (&test_case.obligations, ""), + ); + let state = measured.as_ref().ok().map(|report| { + report + .form_results + .iter() + .find(|form| form.id == "sf.functions.count-if") + .expect("form") + .state + }); + let counts = measured.as_ref().map_or((0, 0), |report| { + assert_eq!( + report.forms.uncredited_cases, + report.uncredited_cases.len(), + "{}", + test_case.description + ); + (report.uncredited_cases.len(), report.obligations.uncredited) + }); + let problems = measured.err().unwrap_or_default().join("; "); + assert_eq!( + (state, counts), + (test_case.expected_state, test_case.expected_uncredited), + "{}: {problems}", + test_case.description + ); + assert!( + problems.contains(test_case.expected_problem), + "{}: {problems}", + test_case.description + ); + } +} + +#[test] +fn given_an_uncredited_case_recorded_twice_when_measuring_then_the_measure_fails() { + let obligations = obligation(1, &citing(COUNT_IF_CASE)) + &obligation(2, &citing(STAND_IN)); + let diverging = (StatementOutcome::DeclaredDivergence, ROW_ORDER_RAISED); + let differing = (StatementOutcome::Differs, &[] as &[&str]); + let test_cases = [ + RepeatedUncreditedTestCase { + description: "a differing statement, then the diverging one", + recorded: [differing, diverging], + expected_problem: "listed twice", + }, + RepeatedUncreditedTestCase { + description: "the diverging statement, then a differing one", + recorded: [diverging, differing], + expected_problem: "is Differs, not a declared divergence", + }, + ]; + for test_case in test_cases { + let [first, second] = test_case.recorded; + let measured = measure_linked( + vec![ + coded(COUNT_IF_CASE, first), + coded(COUNT_IF_CASE, second), + coded(STAND_IN, (StatementOutcome::Matching, &["SBL0003"])), + ], + &format!("{LINKS}{ROW_ORDER}"), + (&obligations, ""), + ); + let problems = measured.err().unwrap_or_default().join("; "); + assert!( + problems.contains(test_case.expected_problem), + "{}: {problems}", + test_case.description + ); + } +}