Hiroshi Inoue wrote:
> Nice.
> I tried a little.
>
> < session 1 >
> => create table ri1 (id int4 primary key);
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit
> index 'ri1_pkey' for table 'ri1'
> CREATE
> => insert into ri1 values (1);
> INSERT 92940 1
> =>create table ri2 (id int4 references ri1 match full on delete restrict);
> NOTICE: CREATE TABLE will create implicit trigger(s) for
> FOREIGN KEY check(s)
> CREATE
> => begin;
> BEGIN
> => delete from ri1 where id=1;
> DELETE 1
>
> < session 2 >
> => insert into ri2 values (1);
> INSERT 92960 1
Outch,
I see the shared visibility conflict. So the CHECK constraint
trigger must get an exclusive lock somehow - I think an
internal "FOR UPDATE OF" can do it - will try.
Thanks, Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck@debis.com (Jan Wieck) #