Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UmrLt-00083E-In for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jun 2013 20:09:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UmrLt-00030m-0a for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jun 2013 20:09:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UmrLr-0002zw-KM for pgsql-bugs@postgresql.org; Wed, 12 Jun 2013 20:09:03 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UmrLn-0006QN-MA for pgsql-bugs@postgresql.org; Wed, 12 Jun 2013 20:09:03 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UmrLm-0006vK-Pq for pgsql-bugs@postgresql.org; Wed, 12 Jun 2013 20:08:58 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1UmrLh-0001y7-C0 for pgsql-bugs@postgresql.org; Wed, 12 Jun 2013 20:08:53 +0000 Date: Wed, 12 Jun 2013 20:08:53 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #8227: referential integrity problem To: pgsql-bugs@postgresql.org From: greg@antrez.pl X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8227 Logged by: Greg Brzezinski Email address: greg@antrez.pl PostgreSQL version: 9.2.4 Operating system: linux Description:=20=20=20=20=20=20=20=20 postgres=3D# CREATE TABLE test( id int primary key, name text ); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_pkey" for table "test" CREATE TABLE postgres=3D# CREATE TABLE test_item( id int primary key, test_id int references test(id) match full on update cascade on delete cascade, content text ); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_item_pkey" for table "test_item" CREATE TABLE postgres=3D# CREATE OR REPLACE FUNCTION test_item_delete_lock() returns trigger AS $f$ postgres$# begin postgres$# return null; postgres$# end; postgres$# $f$ language plpgsql; CREATE FUNCTION postgres=3D# CREATE TRIGGER test_item_delete_lock BEFORE DELETE ON test_item FOR EACH ROW EXECUTE PROCEDURE test_item_delete_lock(); CREATE TRIGGER postgres=3D# postgres=3D# insert into test values (1, 'one'); INSERT 0 1 postgres=3D# insert into test_item values (1, 1, 'for one'); INSERT 0 1 postgres=3D# delete from test where id =3D 1; DELETE 1 postgres=3D# select * from test_item; id | test_id | content ----+---------+--------- 1 | 1 | for one (1 row) postgres=3D# select * from test; id | name ----+------ (0 rows) Is it ok that we loose referential integrity by locking DELETE on table test_item ? --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs