Skip to content

Add hint to CTAS using UDFs that they are not currently supported #99002

@msirek

Description

@msirek

All of the following CREATE OR REPLACE VIEW statements return this error:

ERROR: unknown function: one(): function undefined
SQLSTATE: 42883

Tests:

CREATE OR REPLACE FUNCTION one() RETURNS INT VOLATILE LANGUAGE SQL AS 'SELECT 1';
SELECT * from one();
CREATE OR REPLACE VIEW select_from_udf AS SELECT * from one();
CREATE OR REPLACE VIEW select_from_udf AS SELECT one();
CREATE OR REPLACE VIEW select_from_udf AS SELECT 1 WHERE 1 = one();

These are supported by Postgres. If we won't support these now, an "unimplemented" error should be returned indicating UDFs in views aren't supported instead of reporting the function doesn't exist.

Jira issue: CRDB-25647

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-quick-winLikely to be a quick win for someone experienced.O-qaT-sql-queriesSQL Queries Team

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions