Search Postgresql Archives

Checking Multiplicity Constraints and Retrieving Data from Error Messages

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

 



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



---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[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