Different Lock Behavior With Create and Drop Foreign Key
Virendra Kumar <viru_7683@yahoo.com>
From: Virendra Kumar <viru_7683@yahoo.com>
To: Pgsql-general General <pgsql-general@postgresql.org>
Date: 2020-04-10T01:40:52Z
Lists: pgsql-general
Hi Team, Here is test case.----create table testx ( v_code character varying(32), client_id bigint ); alter table testx add constraint testx_pkey primary key (v_code); create table testy ( dxid bigint, v_code character varying(32) ); alter table testy add constraint testy_pkey primary key (dxid);create index on testy (v_code); Let's begin two session, in session1 I am going begin a transaction and run select on parent table: Session1----begin;select * from testx; On another session let's call session2, I am running create FK on second table Session2--- alter table testy add constraint testy_fkey foreign key (v_code) references testx(v_code); <--This works.alter table testy drop constraint testy_fkey; <--Hangs Regards,Virendra Kumar
Commits
-
Doc: clarify locking requirements for ALTER TABLE ADD FOREIGN KEY.
- f333d35428c1 13.0 landed
- aa4416dcd924 11.8 landed
- a88e5886c59c 12.3 landed
- 61a9b814c553 10.13 landed
- 2cab4ad81bcb 9.5.22 landed
- 1d676ffd41be 9.6.18 landed