From: Raúl Marín Rodríguez Date: Fri, 30 Aug 2019 14:58:55 +0000 (+0000) Subject: _postgis_drop_function_if_needed: Update ST_GeoJSON args X-Git-Tag: 3.0.0beta1~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b906c29cb316958697120f83f7fe1c28ae38d3d;p=postgis _postgis_drop_function_if_needed: Update ST_GeoJSON args Related to #4483 git-svn-id: http://svn.osgeo.org/postgis/trunk@17797 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/postgis_before_upgrade.sql b/postgis/postgis_before_upgrade.sql index fc5905856..60d453c09 100644 --- a/postgis/postgis_before_upgrade.sql +++ b/postgis/postgis_before_upgrade.sql @@ -21,7 +21,18 @@ -- Helper function to drop functions when they match the full signature --- Requires schema, name and __identity_arguments__ as extracted from pg_catalog +-- Requires schema, name and __exact arguments__ as extracted from pg_catalog.pg_get_function_arguments +-- You can extract the old function arguments using a query like: +-- SELECT p.oid as oid, +-- n.nspname as schema, +-- p.proname as name, +-- pg_catalog.pg_get_function_arguments(p.oid) as arguments +-- FROM pg_catalog.pg_proc p +-- LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace +-- WHERE +-- LOWER(n.nspname) = LOWER('public') AND +-- LOWER(p.proname) = LOWER('ST_AsGeoJson') +-- ORDER BY 1, 2, 3, 4; CREATE OR REPLACE FUNCTION _postgis_drop_function_if_needed( function_schema text, function_name text, @@ -150,7 +161,7 @@ SELECT _postgis_drop_function_if_needed ( '@extschema@', 'ST_AsGeoJson', - 'r record, geom_column text, maxdecimaldigits int4, pretty_print bool' + $args$r record, geom_column text DEFAULT ''::text, maxdecimaldigits integer DEFAULT 15, pretty_print boolean DEFAULT false$args$ ); -- FUNCTION ST_LineCrossingDirection changed argument names in 3.0