Hi all,
I have built my geology/mine database in Postgres and the front end in
MS Access(I hate it too but still haven't decided on a good
alternative). Now when I ported my dbf to Postgres I didn't put all the
constraints and referencial integrety (relationships) into it so I am
now going back through it and refining it.
Now I am adding the "not null" constraints to various columns. I am
adding them with the ALTER TABLE mytable ADD CONSTRAINT thekeyname_key
CHECK (thefield IS NOT NULL);. When I do a \d+ thetable, psql returns
the proper constraint and all works fine. But the constraint (not null)
does not appear in the modifiers colunm of the \d+ command but below the
column list as a Constraint.
Is adding the not null constraint at the time of creating a table the
same as adding a "constraint" later? If it is different is there a
performance difference?
Phillip J. Allen
Consulting Geochemist/Geologist