There is another option to do it directly in db_postgres constraints "auto detection"
https://www.postgresql.org/docs/9.1/static/catalog-pg-constraint.html
We would search the catalog :
select conntype from pg_constraint where conrelid = (select oid from pg_class where relname like 'location_test') and contype = u;
select conntype from pg_constraint where conrelid = (select oid from pg_class where relname like 'location_test') and contype = p;
wich would return : location_ruid_idx_test
or location_test_pkey
Then we can save this in the module memory :
char *db_name;
char *db_table;
char *unique_contraint;
char *primary_key_constraint;
};
And use it automatically in the next queries ...
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.