postgresql7.1 select conname, 'CHECK (' || consrc || ')' as consrc from pg_catalog.pg_constraint where contypid = (select oid from pg_catalog.pg_type where typname='$domain');