Re: [HACKERS] FOREIGN KEY and shift/reduce

Поиск
Список
Период
Сортировка
От wieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] FOREIGN KEY and shift/reduce
Дата
Msg-id m11vCJO-0003kJC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на RE: [HACKERS] FOREIGN KEY and shift/reduce  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Список pgsql-hackers
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) #

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: Book - SQL Aggregates
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] When is 7.0 going Beta?