Hello C-(trigger)-experts,
I have to find out if a column ( i = 0, …,
tupdesc->natts-1 ) is part of a primary key
but for performance reasons I do not want to execute another query via SPI.
Is this possible?
Currently I did not find a way, instead I check for “not
null” attribute tupdesc->attrs[i]->attnotnull
and in addition if the column is used in an index via relation->rd_indexattr
but this Bitmapset has 8 leading zeros.
Is there a define which I can use instead of hardcode the 8? Currently I use bms_is_member(i
+ 8, rd_indexattr)
Thank you,
Michael