Project

General

Profile

« Previous | Next » 

Revision 12676

schemas/util.sql: EXCEPTION blocks with multiple exception types: use OR to merge exception types into one WHEN block

View differences:

trunk/schemas/util.sql
958 958
BEGIN
959 959
	PERFORM util.eval(sql);
960 960
EXCEPTION
961
WHEN duplicate_table THEN NULL;
962
WHEN duplicate_object THEN NULL; -- e.g. constraint
963
WHEN duplicate_column THEN NULL;
964
WHEN duplicate_function THEN NULL;
961
WHEN   duplicate_table
962
	OR duplicate_object -- eg. constraint
963
	OR duplicate_column
964
	OR duplicate_function
965
THEN NULL;
965 966
WHEN invalid_table_definition THEN
966 967
	IF SQLERRM LIKE 'multiple primary keys for table % are not allowed' THEN NULL;
967 968
	ELSE RAISE;
......
3768 3769
BEGIN
3769 3770
	PERFORM util.eval(sql);
3770 3771
EXCEPTION
3771
	/* trying to add NOT NULL column to parent table, which cascades to child
3772
	table whose values for the new column will be NULL */
3773
	WHEN not_null_violation THEN NULL;
3774
	WHEN wrong_object_type THEN NULL; -- trying to alter a view's columns
3775
	WHEN undefined_column THEN NULL;
3776
	WHEN duplicate_column THEN NULL;
3772
WHEN   not_null_violation
3773
		/* trying to add NOT NULL column to parent table, which cascades to
3774
		child table whose values for the new column will be NULL */
3775
	OR wrong_object_type -- trying to alter a view's columns
3776
	OR undefined_column
3777
	OR duplicate_column
3778
THEN NULL;
3777 3779
END;
3778 3780
$$;
3779 3781

  

Also available in: Unified diff