cockroachdb / cockroachdb/cockroach
sql: creating a udf with a builtin keyword name should fail
Open
C-bug
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Some keyword functions like `substring` and `trim` are not allowed as UDFs in postgres, e.g.,:
```
marcus=# CREATE FUNCTION substring() RETURNS VOID LANGUAGE SQL AS '';
ERROR: 42601: syntax error at or near "("
LINE 1: CREATE FUNCTION substring() RETURNS VOID LANGUAGE SQL AS '';
^
LOCATION: scanner_yyerror, scan.l:1180
```
We currently allow these functions to be created in CRDB, though they can never be executed. We should return a syntax error for compatibility.
Jira issue: CRDB-31880
Contributor guide
Assessment
This issue has not been assessed yet.