Client: Simplify PG12/Postgis 3 interaction

This commit is contained in:
Raúl Marín
2020-04-07 12:11:46 +02:00
parent d0557049c0
commit 4b6c5a23db
9 changed files with 46 additions and 120 deletions

View File

@@ -18,16 +18,3 @@ $func$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION cdb_dataservices_client.cdb_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;
-- PG12_DEPRECATED
-- Create geomval if it doesn't exist (in postgis 3+ it only exists in postgis_raster)
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'geomval') THEN
CREATE TYPE cdb_dataservices_client.geomval AS (
geom geometry,
val double precision
);
END IF;
END$$;