Fix incorrect access to pg_index.indcollation.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Mar 2011 17:10:50 +0000 (12:10 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 6 Mar 2011 17:10:50 +0000 (12:10 -0500)
Since this field is after a variable-length field, it can't simply be
accessed via the C struct for pg_index.  Fortunately, the relcache already
did the dirty work of pulling the information out to where it can be
accessed easily, so this is a one-line fix.

Andres Freund

src/backend/access/index/indexam.c

index 6e6af18d4717dc317444bf2866fadd913a28fefd..803bb06398583de764232d59215ef340803c89f2 100644 (file)
@@ -872,8 +872,7 @@ index_getprocinfo(Relation irel,
                                 procnum, attnum, RelationGetRelationName(irel));
 
                fmgr_info_cxt(procId, locinfo, irel->rd_indexcxt);
-               fmgr_info_collation(irel->rd_index->indcollation.values[attnum-1],
-                                                       locinfo);
+               fmgr_info_collation(irel->rd_indcollation[attnum-1], locinfo);
        }
 
        return locinfo;