diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-08 16:08:05 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-08 16:08:05 -0500 |
commit | 7e2f906201c8bb95f7fb17e56b8740c38bda5441 (patch) | |
tree | 114e6deb781a6fb05a3dcfd70d09ca8805d641ff /src/backend/commands/cluster.c | |
parent | 56a57473a999b0497e63bde3e303beda5a3c0ff3 (diff) | |
download | postgresql-7e2f906201c8bb95f7fb17e56b8740c38bda5441.tar.gz postgresql-7e2f906201c8bb95f7fb17e56b8740c38bda5441.zip |
Remove pg_am.amindexnulls.
The only use we have had for amindexnulls is in determining whether an
index is safe to cluster on; but since the addition of the amclusterable
flag, that usage is pretty redundant.
In passing, clean up assorted sloppiness from the last patch that touched
pg_am.h: Natts_pg_am was wrong, and ambuildempty was not documented.
Diffstat (limited to 'src/backend/commands/cluster.c')
-rw-r--r-- | src/backend/commands/cluster.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index 560f42b65e8..19c3cf9674c 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -436,43 +436,6 @@ check_index_is_clusterable(Relation OldHeap, Oid indexOid, bool recheck, LOCKMOD errmsg("cannot cluster on partial index \"%s\"", RelationGetRelationName(OldIndex)))); - if (!OldIndex->rd_am->amindexnulls) - { - AttrNumber colno; - - /* - * If the AM doesn't index nulls, then it's a partial index unless we - * can prove all the rows are non-null. Note we only need look at the - * first column; multicolumn-capable AMs are *required* to index nulls - * in columns after the first. - */ - colno = OldIndex->rd_index->indkey.values[0]; - if (colno > 0) - { - /* ordinary user attribute */ - if (!OldHeap->rd_att->attrs[colno - 1]->attnotnull) - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot cluster on index \"%s\" because access method does not handle null values", - RelationGetRelationName(OldIndex)), - recheck - ? errhint("You might be able to work around this by marking column \"%s\" NOT NULL, or use ALTER TABLE ... SET WITHOUT CLUSTER to remove the cluster specification from the table.", - NameStr(OldHeap->rd_att->attrs[colno - 1]->attname)) - : errhint("You might be able to work around this by marking column \"%s\" NOT NULL.", - NameStr(OldHeap->rd_att->attrs[colno - 1]->attname)))); - } - else if (colno < 0) - { - /* system column --- okay, always non-null */ - } - else - /* index expression, lose... */ - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("cannot cluster on expressional index \"%s\" because its index access method does not handle null values", - RelationGetRelationName(OldIndex)))); - } - /* * Disallow if index is left over from a failed CREATE INDEX CONCURRENTLY; * it might well not contain entries for every heap row, or might not even |