Re: [GENERAL] Constraint between 2 tables and taking a coherent snapshot of both

2009-08-06 Thread decibel
On Jul 26, 2009, at 1:32 PM, Ivan Sergio Borgonovo wrote: Actually a serializable transaction doesn't even seem a too bad solution... but I just would like to understand better how to manage this situation so that I could make it as simple as possible AND lower as much as possible the chances tha

[GENERAL] Constraint between 2 tables and taking a coherent snapshot of both

2009-07-26 Thread Ivan Sergio Borgonovo
Suppose I've create table m1 ( a int primary key, cm1 int, cm2 int, ... ); create r1 ( a int references m1 (a), cr1 int, cr2 int, ... ); and cm1 possible values depends on some function of cr1 for a given a. I actually have a plpgsql function that returns the possible choices for cm1 fo