cockroachdb / cockroachdb/cockroach
sql: support types "anycompatible" and "anycompatiblearray"
Open
A-sql-pgcompat
A-sql-routine
A-sql-typing
C-enhancement
O-qa
T-sql-queries
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
CockroachDB does not currently support the types "anycompatible" and "anycompatiblearray" in UDFs.
**Describe the solution you'd like**
Trying to create a function such as:
```
CREATE FUNCTION make_array2(anycompatible, anycompatible)
RETURNS anycompatiblearray AS $$
SELECT ARRAY[$1, $2];
$$ LANGUAGE SQL;
```
Fails on CRDB with the error:
```
ERROR: type "anycompatible" does not exist
SQLSTATE: 42704
```
Type "anycompatiblearray" also does not exist.
Since Postgres supports these, we should too for compatibility.
Jira issue: CRDB-26308
Contributor guide
Assessment
This issue has not been assessed yet.