cockroachdb / cockroachdb/cockroach

sql: PERFORM keyword is unsupported in plpgsql

Open
#108,416 1 comment 0 reactions 0 assignees View on GitHub
A-sql-plpgsql A-sql-udf A-tools-efcore C-bug docs-done docs-known-limitation E-starter O-community T-sql-foundations X-blathers-triaged
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

Trying to create a user defined function as follows:

```
CREATE FUNCTION "AddValues" (a INT, b INT) RETURNS INT
AS $$ SELECT $1 + $2 $$ LANGUAGE SQL;

CREATE FUNCTION "IsDate"(s TEXT) RETURNS BOOLEAN
AS $$
BEGIN
PERFORM s::DATE;
RETURN TRUE;
EXCEPTION WHEN OTHERS THEN
RETURN FALSE;
END;
$$ LANGUAGE PLPGSQL;
```

returns `plpgsql not supported in user-defined functions`

**Additional context**
What was the impact?

Add any other context about the problem here.

@fqazi This affects efcore.pg tests

Jira issue: CRDB-30455

Epic CRDB-49018

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.