RE: [HACKERS] FOREIGN KEY and shift/reduce

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема RE: [HACKERS] FOREIGN KEY and shift/reduce
Дата
Msg-id 001701bf4068$04aebc40$2801007e@cadzone.tpf.co.jp
обсуждение исходный текст
Ответ на FOREIGN KEY and shift/reduce  (wieck@debis.com (Jan Wieck))
Ответы Re: [HACKERS] FOREIGN KEY and shift/reduce  (wieck@debis.com (Jan Wieck))
Re: [HACKERS] FOREIGN KEY and shift/reduce  (wieck@debis.com (Jan Wieck))
Список pgsql-hackers
> -----Original Message-----
> From: owner-pgsql-hackers@postgreSQL.org
> [mailto:owner-pgsql-hackers@postgreSQL.org]On Behalf Of Jan Wieck
> 
> Hi,
> 
>     I  just  committed  a  patch that turns on FOREIGN KEY. Thus,
>     REFERENCES used in CREATE TABLE now automatically creates the
>     appropriate  constraint  triggers.  The  implementation  also
>     supports  omitting  the  PK   column   definition,   if   the
>     corresponding  columns  should  be  the  PRIMARY  KEY  of the
>     referenced table.
> 
>     Also I completed some more of the generic trigger procs.  For
>     MATCH  FULL,  the  key  existence check in PK table and these
>     actions are completed:
> 
>         ON DELETE RESTRICT
>         ON DELETE CASCADE
>         ON UPDATE RESTRICT
>         ON UPDATE CASCADE
>

Nice.
I tried a little.

< session 1 >
=> create table ri1 (id int4 primary key);NOTICE:  CREATE TABLE/PRIMARY KEY will create implicitindex '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)forFOREIGN KEY check(s)CREATE
 
=> begin;BEGIN
=> delete from ri1 where id=1;DELETE 1 

< session 2 >
=> insert into ri2 values (1);INSERT 92960 1

< session 1 >
=> commit;END
=> select * from ri1;id--(0 rows)
=> select * from ri2;id-- 1(1 row)

Is this a temporary behavior ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp


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

Предыдущее
От: Chris Ian Capon Fiel
Дата:
Сообщение: Postgresql in win9x
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] When is 7.0 going Beta?