Toad World® Forums

domains and named check constraints

Hello all,

if I add a check constraint to a domain, and then associate the domain to a field, I obtain an unnamed check constraint. Is there a way to obtain a named check constraint instead? (in my standards, ckc_%columnname%)

(also, I’ve found there’s no null/not null attribute in domains… maybe could be interesting to have it? so you can have domains like: “MANDATORY DESCRIPTION”… “OPTIONAL DESCRIPTION”… )

(database: postgresql 9.1)

Hi,

see attached pictures. This way you should achieve what you want.

Regards,

Vaclav
chk00.png

Hi,

see attached pictures. This way you should achieve what you want.

Regards,

Vaclav
chk01.png

Dear Vaclav,

yes! this does the trick! You know what confused me? You double-clicked on constraint, and there on name you are allowed to use application variable columnname. But I tried to edit the name directly from here... you see I pressed F2 to edit name and then application variable window.. but here... no column name available!!!! (then without knowing the change in DDL generation I was stuck anyway.... but...)

Now, if you find me a solution for the unchangeable constraints for fk fields.....

Message was edited by: roberto_icardi_218