recurse-into-ranges-too.patch

text/x-diff

Filename: recurse-into-ranges-too.patch
Type: text/x-diff
Part: 1
Message: Re: unsupportable composite type partition keys

Patch

Format: unified
File+
src/backend/catalog/heap.c 9 0
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 82398da..452a7f3 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -668,6 +668,15 @@ CheckAttributeType(const char *attname,
 
 		containing_rowtypes = list_delete_last(containing_rowtypes);
 	}
+	else if (att_typtype == TYPTYPE_RANGE)
+	{
+		/*
+		 * If it's a range, recurse to check its subtype.
+		 */
+		CheckAttributeType(attname, get_range_subtype(atttypid), attcollation,
+						   containing_rowtypes,
+						   flags);
+	}
 	else if (OidIsValid((att_typelem = get_element_type(atttypid))))
 	{
 		/*