Fixed exception safe functions
This commit is contained in:
parent
5307078171
commit
5989cb1dff
@ -18,8 +18,8 @@ BEGIN
|
|||||||
<% unless superuser_function? -%>SELECT u, o, p INTO username, orgname, apikey_permissions FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text, p json);
|
<% unless superuser_function? -%>SELECT u, o, p INTO username, orgname, apikey_permissions FROM cdb_dataservices_client._cdb_entity_config() AS (u text, o text, p json);
|
||||||
<% if requires_permission %>IF apikey_permissions IS NULL OR NOT apikey_permissions::jsonb ? '<%= permission_name %>' THEN
|
<% if requires_permission %>IF apikey_permissions IS NULL OR NOT apikey_permissions::jsonb ? '<%= permission_name %>' THEN
|
||||||
RAISE EXCEPTION '<%= permission_error %>';
|
RAISE EXCEPTION '<%= permission_error %>';
|
||||||
END IF;
|
END IF;<% end %>
|
||||||
<% else %>SELECT u, o INTO username, orgname FROM <%= DATASERVICES_CLIENT_SCHEMA %>._cdb_entity_config() AS (u text, o text, p json);<% end %><% end %>
|
<% else %>SELECT u, o INTO username, orgname FROM <%= DATASERVICES_CLIENT_SCHEMA %>._cdb_entity_config() AS (u text, o text, p json);<% end %>
|
||||||
-- JSON value stored "" is taken as literal
|
-- JSON value stored "" is taken as literal
|
||||||
IF username IS NULL OR username = '' OR username = '""' THEN
|
IF username IS NULL OR username = '' OR username = '""' THEN
|
||||||
RAISE EXCEPTION 'Username is a mandatory argument, check it out';
|
RAISE EXCEPTION 'Username is a mandatory argument, check it out';
|
||||||
|
Loading…
Reference in New Issue
Block a user