Checking Multiplicity Constraints and Retrieving Data from Error Messages
От | Ledina Hido |
---|---|
Тема | Checking Multiplicity Constraints and Retrieving Data from Error Messages |
Дата | |
Msg-id | 78BC9821-A092-4B60-9200-94C9B6C292EF@ecs.soton.ac.uk обсуждение исходный текст |
Ответы |
Re: Checking Multiplicity Constraints and Retrieving Data from Error Messages
Re: Checking Multiplicity Constraints and Retrieving |
Список | pgsql-general |
As part of my 4th Year Group Design Project, I am required to build a database system that will validate and then store the data. As such I am currently investigating different DB, to choose the most suitable one. I liked many features of PostgreSQL (eg deferring transactions) but there are a couple of things I am not very clear about that I would need for the project. First of all, is there any way of limiting the number of rows in a table, referencing to the same element of another table? For example, force a manager not to have more than 10 employees under his control. In a way this can be seen as checking the multiplicity of the relation between the two tables. I know one way would be using triggers, but I was wondering if there was a way of specifying this when the table is constructed. Second, is there any way of getting more details out of an error message? So for example, when doing a bulk upload to the database, rather than just getting "Cannot add or update a child row: a foreign key constraint fails" I would like to know which particular insert statement (out of the 1000 I have) caused the problem, or which field in this statement broke the constraint. Any help would be much appreciated. Ledina
В списке pgsql-general по дате отправления: