Different Lock Behavior With Create and Drop Foreign Key

Поиск
Список
Период
Сортировка
От Virendra Kumar
Тема Different Lock Behavior With Create and Drop Foreign Key
Дата
Msg-id 834603375.3470346.1586482852542@mail.yahoo.com
обсуждение исходный текст
Ответы Re: Different Lock Behavior With Create and Drop Foreign Key  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Casey Meijer
Дата:
Сообщение: ext4 tuning parameters
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Different Lock Behavior With Create and Drop Foreign Key