Re: [GENERAL] [NOVICE] Recursive relationship - preventing cross-index entries.

2007-07-02 Thread Andrew Maclean
Thanks to you all for all your help and comments. I finally ended up creating a trigger to check the constraints. This has the added benefit that more than one constraint can be checked in the one trigger. As to whether it is the best model or not for what I want to do. This question is more

Re: [GENERAL] [NOVICE] Recursive relationship - preventing cross-index entries.

2007-06-20 Thread Richard Huxton
Michael Glaesemann wrote: INSERT INTO accounts_receivable_receipts (accounts_receivable_id, receipt_id) VALUES (2, 1), (4, 3), (6, 1), (5, 3); I have not done much accounting-style design, and I don't think this is really the best way to set these up (for example, I think it's a bit odd to

Re: [GENERAL] [NOVICE] Recursive relationship - preventing cross-index entries.

2007-06-20 Thread Sean Davis
Andrew Maclean wrote: I got no answer so I am trying again. In a nutshell, if I have a recrusive relationship as outlined below, how do I implement a rule for the adjustments table that prevents the entry of an Id into the Ref column if the id exists in the Id column and vice versa? If

Re: [GENERAL] [NOVICE] Recursive relationship - preventing cross-index entries.

2007-06-19 Thread Michael Glaesemann
[Removing pgsql-novice. Please don't cross-post. Choose one list or another at a time. ] On Jun 19, 2007, at 23:04 , Andrew Maclean wrote: I got no answer so I am trying again. In a nutshell, if I have a recrusive relationship as outlined below, how do I implement a rule for the