Project

General

Profile

« Previous | Next » 

Revision 13454

bugfix: schemas/util.sql: force_recreate(): need to drop users in reverse to avoid dependencies that block the drop

View differences:

trunk/schemas/util.sql
1801 1801
WHEN dependent_objects_still_exist THEN
1802 1802
	IF users IS NOT NULL THEN RAISE; END IF; -- save_drop_views() didn't fix it
1803 1803
	GET STACKED DIAGNOSTICS PG_EXCEPTION_DETAIL = PG_EXCEPTION_DETAIL;
1804
	users = array(SELECT * FROM util.regexp_matches_group(
1805
		PG_EXCEPTION_DETAIL, '(?m)^view (.*) depends on [[:lower:]]+ .*$'));
1804
	users = util.array_reverse(array(SELECT * FROM util.regexp_matches_group(
1805
		PG_EXCEPTION_DETAIL, '(?m)^view (.*) depends on [[:lower:]]+ .*$')));
1806 1806
	PERFORM util.debug_print_var('PG_EXCEPTION_DETAIL', PG_EXCEPTION_DETAIL);
1807 1807
	PERFORM util.debug_print_var('users', users);
1808 1808
	IF util.is_empty(users) THEN RAISE; END IF;

Also available in: Unified diff