Re: How to ensure data consistency?

From: ddtl <fake_at_address.com>
Date: Tue, 07 Sep 2004 11:16:13 -0700
Message-ID: <3fsrj0lpe76pfvfjfe1ur2ubpb3hqu69fg_at_4ax.com>


>Try a Google search on "generalization specialization relational design".
>
>After looking at some of the websites, come back and tell us if they
>helped, and if you still have questions.

Thanks, I found what I was looking for - which is not what I hoped to find, though - according to that article:

http://www.tomjewett.com/dbdesign/dbdesign.php?page=subclass.php&imgsize=largest

it is impossible to enforce specialization constraints, and the only way to ensure that every item with additional properties in the super-table has an entry in the appropriate sub-table, is in the front end and not in a database itself :-(.

Probably there is a need to design a separate input form for each type of items in the super-table (so that the user won't have to think into which sub-table he has to enter an additional information), and to commit (programmatically) user's input to a database only after he had filled in all the additional properties - then the front-end should create an entry in a super-table. If succeeded, it should create an additional entry in an appropriate sub-table, and if there was an error - to delete an entry in a super-table (that probably should be done in a transaction).

I thought that using a good database (like postgresql I am using) will allow give the user familiar only with INSERT and UPDATE commands a direct access to a database to add new data, and a carefully implemented database rules will prevent that user from doing anything to compromise data integrity. Apparently, it is not so :(. Received on Tue Sep 07 2004 - 20:16:13 CEST

Original text of this message