Received: from hotmail.com (f213.law10.hotmail.com [64.4.15.213]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7EBXjP79544 for ; Tue, 14 Aug 2001 07:33:45 -0400 (EDT) (envelope-from mister_ics@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Aug 2001 04:33:42 -0700 Received: from 212.216.195.144 by lw10fd.law10.hotmail.msn.com with HTTP; Tue, 14 Aug 2001 11:33:42 GMT X-Originating-IP: [212.216.195.144] From: "Mister ics" To: pgsql-sql@postgresql.org Subject: on update restrict Date: Tue, 14 Aug 2001 11:33:42 Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Message-ID: X-OriginalArrivalTime: 14 Aug 2001 11:33:42.0783 (UTC) FILETIME=[F8AC28F0:01C124B4] X-Archive-Number: 200108/176 X-Sequence-Number: 4398 Hi, I'm a little confused by the "on update restrict" option in a referential integrity constraint. I don't know if i have not understood the meaning of this statement or it does not work properly. I think that if it is specified ON UPDATE RESTRICT in a foreign key costraint, the sql-server should not perform updates on the referenced rows. Here an example: testdb=>create table t1 ( id int primary key, foo int); NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 't1_pkey' for table 't1' CREATE testdb=>create table t2 ( id int primary key, ref int references t1(id) on update restrict); NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 't2_pkey' for table 't2' NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) CREATE testdb=>insert into t1 values (1,3000); INSERT 19116 1 testdb=>insert into t2 values (1,1); INSERT 19117 1 testdb=> update t1 set foo=2900 where id=1; UPDATE 1 <--- for me is wrong, we have updated a row referenced by t2 with ON UPDATE RESTRICT OPTION What do you think about ? Thanks in advance Regards, Silvio _________________________________________________________________ Scarica GRATUITAMENTE MSN Explorer all'indirizzo http://explorer.msn.it/intl.asp