dataservices-api/client/templates/20_public_functions.erb

17 lines
495 B
Plaintext
Raw Normal View History

--
-- Public geocoder API function
--
-- These are the only ones with permissions to publicuser role
-- and should also be the only ones with SECURITY DEFINER
2015-11-19 01:38:06 +08:00
CREATE OR REPLACE FUNCTION <%= GEOCODER_CLIENT_SCHEMA %>.<%= name %> (<%= params_with_type %>)
RETURNS <%= return_type %> AS $$
DECLARE
2015-11-19 01:38:06 +08:00
ret <%= return_type %>;
BEGIN
2015-11-19 02:00:08 +08:00
SELECT <%= GEOCODER_CLIENT_SCHEMA %>._<%= name %>(session_user, txid_current(), <%= params %>) INTO ret;
RETURN ret;
END;
$$ LANGUAGE 'plpgsql' SECURITY DEFINER;