BUG #6268: multiple update with on cascade

From: "Roman Lytovchenko" <roman(dot)lytovchenko(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6268: multiple update with on cascade
Date: 2011-10-25 08:58:55
Message-ID: 201110250858.p9P8wtvv085658@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6268
Logged by: Roman Lytovchenko
Email address: roman(dot)lytovchenko(at)gmail(dot)com
PostgreSQL version: 9.1.1
Operating system: Mac OS X 10.6.8
Description: multiple update with on cascade
Details:

create table t2 (

a text not null,
b text null,

constraint t2_pk primary key (a),

constraint t2_t2_fk foreign key (b)
references t2 (a) match simple
on update cascade -- !
on delete cascade
deferrable
initially deferred -- !
);

insert into t2 (a, b)
values
('www', 'www'),
('asd', 'asd');


-- run this transaction in another connection!
start transaction;
set constraints all immediate;

update t2
set a = '123'
where a = 'www';

select
a, b
from t2;

-- this update failed with
-- ERROR: insert or update on table "t2" violates foreign key
constraint "t2_t2_fk"
-- Detail: Key (b)=(123) is not present in table "t2".

update t2
set a = 'kkk'
where a = '123';

commit;

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2011-10-25 09:09:52 Re: BUG #6266: Create temp tables on Slave
Previous Message Maksym Boguk 2011-10-25 08:58:45 BUG #6267: Wrong results in pg_database_size