On Mon, Oct 25, 2010 at 5:24 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> I think that's easier when the PK must contain the FK, because then you
> only need to lock one record. Even when you need to lock multiple
> records, it seems feasible, and is just an index lookup, right? Do you
> see a particular problem?
Well if you lock multiple records then it's not clear what operations
you should conflict with. Removing any one of them wouldn't actually
invalidate the foreign key reference unless you remove the last one.
I always assumed this was why we require the unique constraint at all.
Otherwise we could just do a sequential scan and lock all the matching
records. but we would be preventing someone from removing those
records even though removing just one wouldn't be breaking the
In response to
pgsql-hackers by date
|Next:||From: David E. Wheeler||Date: 2010-10-26 01:02:04|
|Subject: Re: Composite Types and Function Parameters |
|Previous:||From: Robert Haas||Date: 2010-10-26 00:38:20|
|Subject: Re: Range Types, discrete and/or continuous|