Search Postgresql Archives

Re: Feature Proposal: Constant Values in Columns or Foreign Keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bartosz Dmytrak wrote:

> according to DB theory:
> 1NF: Table faithfully represents a relation and has no repeating groups
> 2NF: No non-prime attribute in the table is functionally dependent on a proper subset of anycandidate key.
> source: http://en.wikipedia.org/wiki/Database_normalization#Normal_forms

> so these constants are not in line with this approach.

This is true.  That's why you would have to guard the "constantness" of the column/attribute with a CHECK constraint, to avoid update anomalies.

Yes, the whole model would be simpler and more beautiful without the type column, and trigger functions on the derived tables instead. On the other hand, the foreign key including the type field might be faster than the foreign key without the type field plus trigger function. So, if this approach is any good, then only if it is actually faster. No, I haven't timed it :-)

Regards,
-- 
Nils Gösche
Don't ask for whom the <Ctrl-G> tolls.

<<attachment: smime.p7s>>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux