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 @@ -42,6 +42,7 @@ unique_key_recheck(PG_FUNCTION_ARGS)
4242 const char * funcname = "unique_key_recheck" ;
4343 Datum checktidDatum ;
4444 Datum tmptidDatum ;
45+ ItemPointerData tmptid ;
4546 Relation indexRel ;
4647 IndexInfo * indexInfo ;
4748 EState * estate ;
@@ -126,7 +127,16 @@ unique_key_recheck(PG_FUNCTION_ARGS)
126127 * it's possible the index entry has also been marked dead, and even
127128 * removed.
128129 */
129- tmptidDatum = checktidDatum ;
130+ if (table_get_row_ref_type (trigdata -> tg_relation ) == ROW_REF_ROWID )
131+ {
132+ /* FIX: Probably wrong assumption */
133+ tmptidDatum = checktidDatum ;
134+ }
135+ else
136+ {
137+ tmptid = * DatumGetItemPointer (checktidDatum );
138+ tmptidDatum = ItemPointerGetDatum (& tmptid );
139+ }
130140 {
131141 IndexFetchTableData * scan ;
132142 bool call_again = false;
You can’t perform that action at this time.
0 commit comments