This isn't directly related to this project; perhaps you know the answer:
I'm writting an extention in C. It's a function for a trigger. I need to dynamically identify which column, or columns, if the primary key is composed of multiple columns, is the primary key -- their indexes or names.
I suppose, the function get_primary_key_attnos can help me.
|
extern Bitmapset *get_primary_key_attnos(Oid relid, bool deferrableOk, |
It returns *Bitstamp. And it's got "nwords" and "words[]". But those return just big numbers, not something that look similar to an index of the primary key column.
Therefore, I haven't been able to figure out how to proceed with it and identify the primary key. Any idea?
This isn't directly related to this project; perhaps you know the answer:
I'm writting an extention in C. It's a function for a trigger. I need to dynamically identify which column, or columns, if the primary key is composed of multiple columns, is the primary key -- their indexes or names.
I suppose, the function get_primary_key_attnos can help me.
postgresql_projects/src/include/catalog/pg_constraint.h
Line 236 in 5afaa2e
It returns *Bitstamp. And it's got "nwords" and "words[]". But those return just big numbers, not something that look similar to an index of the primary key column.
Therefore, I haven't been able to figure out how to proceed with it and identify the primary key. Any idea?