You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
There was discussion on this in the above PR. By default Postgres will add the role’s name to its search path and MessageDB is intended to be used in tandem with a search path that includes message_store. If you’re not using the provided role you’ll need to alter the search path of your role. A few methods for doing that were described in the above PR
#43 (comment)
This issue indicates this’ll not be a problem in the next major version
Here's fun little workaround for anyone in the future needing to get around this.
You can modify the search path in the connection string directly: ?options=-c%20search_path%3Dmessage_store
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.
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?
The text was updated successfully, but these errors were encountered: