Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA25185 for ; Thu, 18 May 2000 23:38:22 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id XAA06192; Thu, 18 May 2000 23:38:19 -0400 (EDT) To: "Stephan Szabo" cc: pgsql-hackers@postgresql.org Subject: Re: [SQL] Foreign keys breaks tables permissions In-reply-to: <001b01bfc13e$1df17600$0c64010a@kick.com> References: <25918.958691826@sss.pgh.pa.us> <001b01bfc13e$1df17600$0c64010a@kick.com> Comments: In-reply-to "Stephan Szabo" message dated "Thu, 18 May 2000 19:58:32 -0700" Date: Thu, 18 May 2000 23:38:19 -0400 Message-ID: <6189.958707499@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/203 "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. Hmm, good point. And I think I see the reason for the protection logic as well: if you can do SELECT FOR UPDATE then you can acquire a lock that will block a competing writer. Therefore, even though you can't modify the table, you can create the same sort of denial- of-service attack that someone with real UPDATE privileges could create, just by leaving your transaction open. So, either we live with update requiring update rights on the table referenced as a foreign key, or we break something else. Grumble. 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? regards, tom lane