dataservices-api/client/sql/10_geocoder_server_conn.sql
Raul Marin b8527514b7 Client: Add PARALLEL and VOLATILE categories
I'm not 100% sure what's appropiate for plproxy functions so, for now,
I've set them up as VOLATILE and PARALLEL UNSAFE
2017-11-14 16:45:36 +01:00

17 lines
551 B
PL/PgSQL

--
-- Geocoder server connection config
--
-- The purpose of this function is provide to the PL/Proxy functions
-- the connection string needed to connect with the server
CREATE OR REPLACE FUNCTION cdb_dataservices_client._server_conn_str()
RETURNS text AS $$
DECLARE
db_connection_str text;
BEGIN
SELECT cartodb.cdb_conf_getconf('geocoder_server_config')->'connection_str' INTO db_connection_str;
SELECT trim(both '"' FROM db_connection_str) INTO db_connection_str;
RETURN db_connection_str;
END;
$$ LANGUAGE 'plpgsql' STABLE PARALLEL SAFE;