Hi! Thanks for all the help.
I finally used savepoints to get what I want. However I don't like this very much. I tried a few other databases (hsqldb, mysql/innodb and oracle), and none of them made the transaction unusable after violating the constraint. Best regards, Ralf. ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match