Project

General

Profile

« Previous | Next » 

Revision 10715

bugfix: schemas/util.sql: set_col_names_with_metadata(): rename any metadata cols rather than re-adding them with new names

View differences:

schemas/util.sql
1550 1550
DECLARE
1551 1551
	row_ util.map;
1552 1552
BEGIN
1553
	-- rename any metadata cols rather than re-adding them with new names
1554
	BEGIN
1555
		PERFORM util.set_col_names(table_, names);
1556
	EXCEPTION
1557
		WHEN array_subscript_error THEN -- selective suppress
1558
			IF SQLERRM LIKE 'arrays must have same bounds' THEN NULL;
1559
				-- metadata cols not yet added
1560
			ELSE RAISE USING ERRCODE = SQLSTATE, MESSAGE = SQLERRM; -- rethrow
1561
			END IF;
1562
	END;
1563
	
1553 1564
	FOR row_ IN EXECUTE $$SELECT * FROM $$||names||$$ WHERE "from" LIKE ':%'$$
1554 1565
	LOOP
1555 1566
		PERFORM util.mk_const_col((table_, row_."to"),

Also available in: Unified diff