Jeff Ortel <[email protected]> writes:
> Milan Zazrivec wrote:
>> On Thursday 21 May 2009 22:23:17 Jeff Ortel wrote:
>>> * Replacing the named NOT NULL constraints in the common tables (.sql)
>>> files with simple NOT NULL keywords.
>>
>> I still don't understand why this thing was done for some not null
>> constraints and not for foreign keys for example.
> Well, unlike the other constraints such as PRIMARY KEY, FOREIGN KEY,
> UNIQUE, CHECK, etc ..., the NULL-ability is typically managed via
> keyword and is stored with the column definition itself. As such, it
> can (and usually is) managed via NOT NULL or NULL keyword(s) using a
> simple ALTER TABLE statement.
One point worth mentioning is that the current Postgres implementation
simply does not store any constraint name attached to a NOT NULL
constraint.
It's not clear to me whether any part of Spacewalk depends on having
such a name. If it does, then we'd have to fake it by translating
simple "NOT NULL" into a "CHECK (field IS NOT NULL)" constraint, which
takes more catalog space and is probably a bit slower to check too.
If this is considered not necessary, then I support Jeff's approach
of removing the names altogether, in hopes of making the Oracle and
Postgres behaviors more alike (ie, prevent any Oracle-based developer
from inserting a dependency on the name of some NOT NULL constraint...)
regards, tom lane
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel