cockroachdb / cockroachdb/cockroach

sql: support types "anycompatible" and "anycompatiblearray"

Open
#100,227 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.