我遇到了一个我找不到解决方案的问题。
我已经成功创建了一个函数。这是函数名称和参数:
CREATE OR REPLACE FUNCTION app_private.create_user(username citext, email text, email_is_verified boolean, name text, avatar_url text, title text DEFAULT NULL::text, color character varying DEFAULT NULL::character varying, user_role smallint DEFAULT 0, password text DEFAULT NULL::text)
RETURNS app_public.users
....
CREATE FUNCTION
我还成功地授予了对角色执行该功能的权限。AND 还创建了一条评论:
grant execute on function app_private.create_user(username citext, email text, email_is_verified bool, name text, avatar_url text, title text, color varchar(7), user_role smallint, password text) to nine_manager;
GRANT
comment on function app_private.create_user(username citext, email text, email_is_verified bool, name text, avatar_url text, title text, color varchar(7), user_role smallint, password text) is
E'Creates a user account.';
COMMENT
但是,当我尝试通过查询创建测试用户时:
SELECT "app_private.create_user"('JS0'::citext, 'test@gmail.com'::text, true::boolean, 'John Smith'::text, 'SY'::text, 'Manager'::text, '#000000'::varchar(7), 5::SMALLINT, 'test'::text);
我收到一个错误:
错误:函数 app_private.create_user(citext, text, boolean, text, text, text, character varying, smallint, text) 不存在
LINE 1: SELECT "app_private.create_user"('SY0'::citext, 'test@gmail ……
我尝试更改查询和强制转换但失败了。差点把我的头发拉出来。
提前谢谢你。