Checking Multiplicity Constraints and Retrieving Data from Error Messages

From: Ledina Hido <lh1101(at)ecs(dot)soton(dot)ac(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Checking Multiplicity Constraints and Retrieving Data from Error Messages
Date: 2005-10-19 14:25:25
Message-ID: 78BC9821-A092-4B60-9200-94C9B6C292EF@ecs.soton.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-10-19 14:53:58 Re: getting around---division by zero on numeric
Previous Message Berend Tober 2005-10-19 14:17:52 Re: getting around---division by zero on numeric