From b2a06c6ed65f2a1d259665915387a54f93796c59 Mon Sep 17 00:00:00 2001 From: manmorjim Date: Wed, 26 Feb 2020 15:42:10 +0100 Subject: [PATCH] Create the type `geomval` if not exist Related to https://github.com/CartoDB/cartodb-platform/issues/6237 --- server/extension/sql/05_postgis3_adapter.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 server/extension/sql/05_postgis3_adapter.sql diff --git a/server/extension/sql/05_postgis3_adapter.sql b/server/extension/sql/05_postgis3_adapter.sql new file mode 100644 index 0000000..4facb46 --- /dev/null +++ b/server/extension/sql/05_postgis3_adapter.sql @@ -0,0 +1,11 @@ +-- 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 geomval AS ( + geom geometry, + val double precision + ); + END IF; +END$$; \ No newline at end of file