extension patch of CREATE OR REPLACE TRIGGER

Поиск
Список
Период
Сортировка
От Osumi, Takamichi
Тема extension patch of CREATE OR REPLACE TRIGGER
Дата
Msg-id 0DDF369B45A1B44B8A687ED43F06557C010BC362@G01JPEXMBYT03
обсуждение исходный текст
Ответы Re: extension patch of CREATE OR REPLACE TRIGGER  (David Rowley <david.rowley@2ndquadrant.com>)
Re: extension patch of CREATE OR REPLACE TRIGGER  (David Steele <david@pgmasters.net>)
Список pgsql-hackers

Dear hackers

 

Hi there !

One past thread about introducing CREATE OR REPLACE TRIGGER into the syntax

had stopped without complete discussion in terms of LOCK level.

 

The past thread is this. I'd like to inherit this one.

https://www.postgresql.org/message-id/flat/0B4917A40C80E34BBEC4BE1A7A9AB7E276F5D9%40g01jpexmbkw05#39f3c956d549c134474724d2b775399c

Mr. Tom Lane mentioned that this change requires really careful study in this thread.

 

First of all, please don't forget I don't talk about DO CLAUSE in this thread.

Secondly, Mr. Surafel Temesgen pointed out a bug but it doesn't appear.

 

Anyway, let's go back to the main topic.

From my perspective, how CREATE OR REPLACE TRIGGER works is,

when there is no counterpart replaced by a new trigger,

CREATE TRIGGER is processed with SHARE ROW EXCLUSIVE LOCK as usual.

 

On the other hand, when there's,

REPLACE TRIGGER procedure is executed with ACCESS EXCLUSIVE LOCK.

 

This feeling comes from my idea

that acquiring ACCESS EXCLUSIVE LOCK when replacing trigger occurs

provides data consistency between transactions and protects concurrent pg_dump.

 

In order to make this come true, as the first step,

I've made a patch to add CREATE OR REPLACE TRIGGER with some basic tests in triggers.sql.

 

Yet, I'm still wondering which part of LOCK level in this patch should be raised to ACCESS EXCLUSIVE LOCK.

Could anyone give me an advise about

how to protect the process of trigger replacement in the way I suggested above ?

 

--------------------

Takamichi Osumi

Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: reloption to prevent VACUUM from truncating empty pages at theend of relation
Следующее
От: "Ideriha, Takeshi"
Дата:
Сообщение: RE: Protect syscache from bloating with negative cache entries