You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e358745
Browse filesBrowse the repository at this point in the historyBrowse files
PostgreSQL: Support the VARIADIC function call argument marker
`pg_get_viewdef` writes the marker into stock system views, so
introspecting `pg_catalog` failed on `pg_publication_tables`:
SELECT concat(VARIADIC a)
-- Expected: ), found: a at Line: 1, Column: 24
The marker is represented additively as `FunctionArg::Variadic`, which
wraps any argument so the named form `f(VARIADIC a => ARRAY[1])` that
PostgreSQL's grammar accepts is preserved too. Parsing is gated on the
new `Dialect::supports_variadic_function_argument`, enabled for
PostgreSQL and the generic dialect.
PostgreSQL reserves the keyword, so there the marker is unambiguous.
Where it is unreserved, the ordinary reading is parsed first and kept
whenever the argument stands on its own, leaving `f(variadic)` and
`f(variadic + 1)` untouched. A clause keyword only ends that reading
when its own syntax follows, so `f(VARIADIC separator)` still marks the
operand while `array_agg(variadic ORDER BY x)` does not.
As in PostgreSQL, the marker is rejected on a wildcard operand, in
combination with `DISTINCT` or `ALL`, and on any but the final argument.
The last check runs in the enclosing argument-list parsers, so the comma
before a table function's `SETTINGS` clause is not read as an argument.
0 commit comments