diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-01-19 16:34:44 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2018-01-19 16:56:42 -0300 |
commit | 7f17fd6fc7125b41218bc99ccfa8165e2d730cd9 (patch) | |
tree | 375b40aba4f7da6a6332d00fe4afd8ad277eb85c /src | |
parent | 8b9e9644dc6a9bd4b7a97950e6212f63880cf18b (diff) | |
download | postgresql-7f17fd6fc7125b41218bc99ccfa8165e2d730cd9.tar.gz postgresql-7f17fd6fc7125b41218bc99ccfa8165e2d730cd9.zip |
Fix CompareIndexInfo's attnum comparisons
When an index column is an expression, it makes no sense to compare its
attribute numbers.
This seems to account for remaining buildfarm fallout from 8b08f7d4820f.
At least, it solves the issue in my local 32bit VM -- let's see what the
rest thinks.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/index.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c index f0223416adf..849a4691277 100644 --- a/src/backend/catalog/index.c +++ b/src/backend/catalog/index.c @@ -1795,8 +1795,10 @@ CompareIndexInfo(IndexInfo *info1, IndexInfo *info2, if (maplen < info2->ii_KeyAttrNumbers[i]) elog(ERROR, "incorrect attribute map"); - if (attmap[info2->ii_KeyAttrNumbers[i] - 1] != - info1->ii_KeyAttrNumbers[i]) + /* ignore expressions at this stage */ + if ((info1->ii_KeyAttrNumbers[i] != InvalidAttrNumber) && + (attmap[info2->ii_KeyAttrNumbers[i] - 1] != + info1->ii_KeyAttrNumbers[i])) return false; if (collations1[i] != collations2[i]) |