Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by hub.org (8.9.3/8.9.3) with ESMTP id HAA41886 for ; Fri, 19 May 2000 07:26:43 -0400 (EDT) (envelope-from Inoue@tpf.co.jp) Received: from tpf.co.jp ([126.0.1.56] (may be forged)) by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with ESMTP id UAA02195; Fri, 19 May 2000 20:25:52 +0900 Message-ID: <39252551.2C3B0B17@tpf.co.jp> Date: Fri, 19 May 2000 20:28:17 +0900 From: Hiroshi Inoue X-Mailer: Mozilla 4.51 [ja] (Win98; I) X-Accept-Language: ja MIME-Version: 1.0 To: Tom Lane CC: Stephan Szabo , pgsql-hackers@postgresql.org Subject: Re: Re: [SQL] Foreign keys breaks tables permissions References: <25918.958691826@sss.pgh.pa.us> <001b01bfc13e$1df17600$0c64010a@kick.com> <6189.958707499@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/237 Tom Lane wrote: > "Stephan Szabo" writes: > > I believe the reason that the trigger does a select for update was > > because otherwise there could exist a case that we select and see it > > and then have the row go away afterwards because nothing stops the > > delete. > > Probably the denial-of-service argument is the weakest of the three > points. Is anyone in favor of reducing SELECT FOR UPDATE to only > requiring "SELECT" rights, and living with the possible lock-that- > you-shouldn't-really-have-been-able-to-get issue? > But what about DELETE CASCADE cases for exmaple ? Maybe RI_trigger should be able to update/insert/delete the referenced table. However another kind of permission for foreign key seems to be needed. i.e only granted users could define foreign key of the referenced table in CREATE (ALTER) TABLE command. Otherwise not granted users could delete tuples of the referenced table by defining a bogus foreign key of the table with DELETE CASCADE option. Comments ? Regards. Hiroshi Inoue Inoue@tpf.co.jp