pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@kick.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [SQL] Foreign keys breaks tables permissions
Date: Thu, 18 May 2000 23:38:19 -0400
Message-ID: <6189.958707499@sss.pgh.pa.us> (raw)
In-Reply-To: <001b01bfc13e$1df17600$0c64010a@kick.com>
References: <m12fMDN-0003lFC@orion.SAPserv.Hamburg.dsh.de>
	<25918.958691826@sss.pgh.pa.us>
	<001b01bfc13e$1df17600$0c64010a@kick.com>

"Stephan Szabo" <sszabo@kick.com> 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



view thread (13+ messages)  latest in thread

Message-ID: <6189.958707499@sss.pgh.pa.us>
Permalink:  ../6189.958707499@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6189.958707499@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sszabo@kick.com, pgsql-hackers@postgresql.org
  Subject: Re: [SQL] Foreign keys breaks tables permissions
  In-Reply-To: <6189.958707499@sss.pgh.pa.us>
  References: <m12fMDN-0003lFC@orion.SAPserv.Hamburg.dsh.de> <25918.958691826@sss.pgh.pa.us> <001b01bfc13e$1df17600$0c64010a@kick.com> <6189.958707499@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox