这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug: cannot track a custom function which returns materialized view #5294

@hsheth2

Description

@hsheth2

I have a materialized view called course_info_table. This view is tracked by Hasura. I've created a custom function as follows:

CREATE FUNCTION search_course_info(query text)
RETURNS SETOF course_info_table AS $$
    SELECT *
    FROM course_info_table
    WHERE info @@ websearch_to_tsquery('english', query)
    ORDER BY ts_rank(info, websearch_to_tsquery('english', query)) DESC
$$ language sql stable;

When I attempt to track this function in Hasura, I get the following error:

[
    {
        "definition": {
            "schema": "public",
            "name": "search_course_info"
        },
        "reason": "in function \"search_course_info\": the function \"search_course_info\" cannot be tracked because the function does not return a SETOF table",
        "type": "function"
    }
]

I'm running Hasura v1.2.2 via Docker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/serverRelated to server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions