Helper function to convert json arrays to PG arrays
This commit is contained in:
parent
e82346e7f6
commit
8cb9e123b1
@ -18,7 +18,12 @@ BEGIN
|
|||||||
|
|
||||||
RETURN ROWS;
|
RETURN ROWS;
|
||||||
END
|
END
|
||||||
$func$ LANGUAGE plpgsql;--
|
$func$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- Taken from https://stackoverflow.com/a/48013356/351721
|
||||||
|
CREATE OR REPLACE FUNCTION jsonb_array_casttext(jsonb) RETURNS text[] AS $f$
|
||||||
|
SELECT array_agg(x) || ARRAY[]::text[] FROM jsonb_array_elements_text($1) t(x);
|
||||||
|
$f$ LANGUAGE sql IMMUTABLE;--
|
||||||
-- Geocoder server connection config
|
-- Geocoder server connection config
|
||||||
--
|
--
|
||||||
-- The purpose of this function is provide to the PL/Proxy functions
|
-- The purpose of this function is provide to the PL/Proxy functions
|
||||||
|
@ -12,4 +12,9 @@ BEGIN
|
|||||||
|
|
||||||
RETURN ROWS;
|
RETURN ROWS;
|
||||||
END
|
END
|
||||||
$func$ LANGUAGE plpgsql;
|
$func$ LANGUAGE plpgsql;
|
||||||
|
|
||||||
|
-- Taken from https://stackoverflow.com/a/48013356/351721
|
||||||
|
CREATE OR REPLACE FUNCTION jsonb_array_casttext(jsonb) RETURNS text[] AS $f$
|
||||||
|
SELECT array_agg(x) || ARRAY[]::text[] FROM jsonb_array_elements_text($1) t(x);
|
||||||
|
$f$ LANGUAGE sql IMMUTABLE;
|
Loading…
Reference in New Issue
Block a user