On Nov 13 06:38, ivan marchesini wrote:
> thank you for your answer...
> I have tried to verify the table
> information_schema.constraint_column_usage, but, and I was really
> surprised, I have found nothing inside it..
> it seems there are not checks!!!
> I have also seen the manual page you suggested but I can't understand
> why I don't have checks in this table...
>
> but I'm sure I have checks in my table.. because they works!!!!!
> does this problem can be related to the fact that I have created the
> checks only after that I have created the table...
> I have used this syntacs:
> alter table tablename add check (......)
I tried to produce same strange behaviour with no luck:
test=# CREATE TABLE cons_test (u int);
CREATE TABLE
test=# ALTER TABLE cons_test
test-# ADD CONSTRAINT forget_my_name CHECK (u > 10);
ALTER TABLE
test=# SELECT constraint_name
test-# FROM information_schema.constraint_column_usage
test-# WHERE table_name = 'cons_test' AND
test-# column_name = 'u';constraint_name
-----------------forget_my_name
(1 row)
Also, you cannot see that constraint listed in the \d table_name output,
ain't? Maybe you should try a hardcoded search over consrc column of
pg_catalog.pg_constraint table.
Regards.