Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRNce-0006hb-O1 for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Mar 2014 15:14:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WRNce-0006d4-79 for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Mar 2014 15:14:08 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRNcb-0006aY-Mu for pgsql-hackers@postgresql.org; Sat, 22 Mar 2014 15:14:05 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WRNcW-0007eA-7Y for pgsql-hackers@postgresql.org; Sat, 22 Mar 2014 15:14:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s2MFDupe018758; Sat, 22 Mar 2014 11:13:57 -0400 From: Tom Lane To: Andrzej Mazurkiewicz cc: pgsql-hackers@postgresql.org Subject: Re: Inheritance of foregn key constraints. In-reply-to: <1547752.joDV9Ig9SK@tata> References: <1523734.6NloWteI3S@tata> <15558.1395411243@sss.pgh.pa.us> <1547752.joDV9Ig9SK@tata> Comments: In-reply-to Andrzej Mazurkiewicz message dated "Sat, 22 Mar 2014 11:51:04 +0100" Date: Sat, 22 Mar 2014 11:13:56 -0400 Message-ID: <18757.1395501236@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andrzej Mazurkiewicz writes: >> So in other words, somebody could (accidentally or maliciously) break the >> constraint by dropping one of its implementation triggers. I doubt that's >> acceptable. > The present postgres behavior ALLOWS accidental or malicious break the > constraint by dropping one of its implementation triggers. Please ref. to the > following example. > The following script has been run by the postgres user. Well, right there you lost me, because superusers are exempt from all permissions checks by definition; and in particular, direct manipulations of the system catalogs by superusers are always out of scope for discussions of what the system should try to protect itself against. (Try "delete from pg_proc;" in a scratch database sometime.) My point is that without the internal dependency, a normal user could do standard SQL commands (ie DROP TRIGGER) and break the FK that way. That's the case that's not acceptable. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers