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  (Martijn van Oosterhout <kleptog@svana.org>)
Re: Checking Multiplicity Constraints and Retrieving  (Simon Riggs <simon@2ndquadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: server , client encoding issue
Следующее
От: ellis@no.spam ()
Дата:
Сообщение: Re: PostgreSQL on Dual Processors, Dual-Core AMD Chips