var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to get check clause from system tables?
I am trying to get the check clause from the system tables.
I looked at information_schema - check_constraints and table_constraints.
I can't figure out how to link the tables to give me the check clause.
I think pg_catalog.pg_constraint is the key.
SELECT c.oid,conname,conrelid,consrc FROM pg_catalog.pg_class c, pg_catalog.pg_constraint WHERE c.oid = conrelid AND contype = 'c' AND c.relname = 'MyTable'
I think I solved it. Hope this is the correct method.
Last edited by GaryK4; 04-14-14 at 19:55.
Not all constraints will be listed with that. If you e.g. have an exclusion constraint it won't show up in consrc.
In that case you'd have have to use pg_get_constraintdef() in order to get the full definition.
And please use [code] tags in the future to format your SQL code.