Skip to content

Functions require schema prefix #49

@tqwewe

Description

@tqwewe

When calling functions, it seems like I need to prefix with message_store., otherwise I get an error saying the function does not exist.

Though, even when executing a function with the prefix, it fails since the body of the function itself calls another function but doesn't include the schema prefix.

SELECT * FROM message_store.get_stream_messages('someStream-123', 0, 1000, condition => 'messages.time::time >= current_time');
ERROR:  function is_category(character varying) does not exist
LINE 1: is_category(get_stream_messages.stream_name)
        ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  is_category(get_stream_messages.stream_name)
CONTEXT:  PL/pgSQL function message_store.get_stream_messages(character varying,bigint,bigint,character varying) line 6 at IF
SQL state: 42883

I believe the is_category function should be message_store.is_category in this snippet:
https://github.com/message-db/message-db/blob/master/database/functions/get-stream-messages.sql#L13

Its possible this prefix might need to be added to other functions, I just haven't done much testing.


Also, is there any reason why I'm forced to use the schema prefix? It seems like other people don't have this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions