Skip to main content

DUCKDB_UNCALLABLE_KEYWORDS

Constant DUCKDB_UNCALLABLE_KEYWORDS 

Source
pub const DUCKDB_UNCALLABLE_KEYWORDS: [&str; 53];
Expand description

Non-reserved keywords that still cannot be a function’s name, lowercase and sorted.

SELECT between(1), SELECT values(1) and SELECT time(1) are parser errors whatever function is registered under the name, and some calls are taken by the grammar before any function lookup: coalesce(x) is the COALESCE operator, so a function called coalesce is never called.

Measured, not taken from a keyword category: for each keyword kw in duckdb_keywords() and each argument count from 0 to 3, a macro "kw" taking that many arguments is created and called as kw(41, …). These are the non-reserved keywords for which no such call reaches the macro — the same 53 on DuckDB 1.4.4, 1.5.0 and 1.5.5 (duckdb_keywords() lists 489 keywords on each). nullif is the one keyword that fails with one argument but works with two, so it is not refused. position is listed although DuckDB ships a function of that name: it is reachable only through the position(a IN b) syntax, never as position(a, b). The sweep calls the name as a scalar; a table function of the same name is refused too. An end-to-end test repeats the sweep against the linked engine.

§On DuckDB 2.0

2.0.0 lists 508 keyword rows (16 new keywords, all callable, and the same 75 reserved) and its parser takes more of these names than 1.x does: anti, by, columns, if, operator, overlay, semi and try_cast are callable there, and none is callable on 1.x but not on 2.0. The list is not narrowed for 2.0: an extension built with quack-rs can be loaded into either engine, and a name only one of them can call is a broken function on the other, so the list is the union of what each supported engine refuses (here, the 1.x set). The end-to-end sweep checks on 2.0 that exactly those eight are refused although 2.0 would take them.