File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ unique_key_recheck(PG_FUNCTION_ARGS)
4444 const char * funcname = "unique_key_recheck" ;
4545 Datum checktidDatum ;
4646 Datum tmptidDatum ;
47+ ItemPointerData tmptid ;
4748 Relation indexRel ;
4849 IndexInfo * indexInfo ;
4950 EState * estate ;
@@ -128,7 +129,16 @@ unique_key_recheck(PG_FUNCTION_ARGS)
128129 * it's possible the index entry has also been marked dead, and even
129130 * removed.
130131 */
131- tmptidDatum = checktidDatum ;
132+ if (table_get_row_ref_type (trigdata -> tg_relation ) == ROW_REF_ROWID )
133+ {
134+ /* FIX: Probably wrong assumption */
135+ tmptidDatum = checktidDatum ;
136+ }
137+ else
138+ {
139+ tmptid = * DatumGetItemPointer (checktidDatum );
140+ tmptidDatum = ItemPointerGetDatum (& tmptid );
141+ }
132142 {
133143 IndexFetchTableData * scan ;
134144 bool call_again = false;
You can’t perform that action at this time.
0 commit comments