[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0beta2-24-gadfa7138a
git at osgeo.org
git at osgeo.org
Fri Jul 29 03:23:54 PDT 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via adfa7138aba1c486e6bda495e112738892fec94b (commit)
from 6f3c183e6f81e2c823235d26929166deb2c982d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit adfa7138aba1c486e6bda495e112738892fec94b
Author: Sandro Santilli <strk at kbt.io>
Date: Fri Jul 29 12:23:15 2022 +0200
Simplify handling of replaced function in upgrade procedure
Avoids unneeded multiple CREATE OR REPLACE FUNCTION blocks
diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl
index 08bf455bd..dfa429dd2 100755
--- a/utils/create_upgrade.pl
+++ b/utils/create_upgrade.pl
@@ -208,40 +208,28 @@ while(<INPUT>)
DO LANGUAGE 'plpgsql'
\$postgis_proc_upgrade\$
DECLARE
- replaced_proc regprocedure;
- rec RECORD;
- new_view_def TEXT;
- sql TEXT;
detail TEXT;
BEGIN
- -- Check if the old function signature, exists
+ -- Rename the replaced function, to avoid ambiguities.
+ -- The renamed function will eventually be drop.
BEGIN
- replaced_proc := '$name($args)'::regprocedure;
+ ALTER FUNCTION $name( $args ) RENAME TO ${renamed};
EXCEPTION
- -- Catch the "function does not exist"
WHEN undefined_function THEN
- RAISE DEBUG 'Function $name($args) does not exist';
+ RAISE DEBUG 'Replaced function $name($args) does not exist';
WHEN OTHERS THEN
GET STACKED DIAGNOSTICS detail := PG_EXCEPTION_DETAIL;
- RAISE EXCEPTION 'Got % (%)', SQLERRM, SQLSTATE
+ RAISE EXCEPTION 'Attempting to rename replaced function $name($args) got % (%)', SQLERRM, SQLSTATE
USING DETAIL = detail;
END;
- IF replaced_proc IS NULL THEN
- $def
- RETURN;
- END IF;
-
- -- Old function signature exists
-
- -- Rename old function, to avoid ambiguities and eventually drop
- ALTER FUNCTION $name( $args ) RENAME TO ${renamed};
-
-
END;
\$postgis_proc_upgrade\$;
EOF
}
+
+ # TODO: set owner to current owner, in case the new signature exists
+
print $def;
}
-----------------------------------------------------------------------
Summary of changes:
utils/create_upgrade.pl | 28 ++++++++--------------------
1 file changed, 8 insertions(+), 20 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list