*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.305 2008/09/30 10:52:12 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.306 2008/10/14 21:47:39 tgl Exp $
*
*
* INTERFACE ROUTINES
to->attislocal = true;
ReleaseSysCache(tuple);
+
+ /*
+ * Make sure the expression yields a type that's safe to store in
+ * an index. We need this defense because we have index opclasses
+ * for pseudo-types such as "record", and the actually stored type
+ * had better be safe; eg, a named composite type is okay, an
+ * anonymous record type is not. The test is the same as for
+ * whether a table column is of a safe type (which is why we
+ * needn't check for the non-expression case).
+ */
+ CheckAttributeType(NameStr(to->attname), to->atttypid);
}
/*