dataservices-api/client/templates/20_public_functions.erb
2015-11-18 18:38:06 +01:00

17 lines
506 B
Plaintext

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