Re: Running query without trigger?

Поиск
Список
Период
Сортировка
От hamann.w@t-online.de
Тема Re: Running query without trigger?
Дата
Msg-id wolfgang-1160711111131.A046709@noten19.local
обсуждение исходный текст
Ответ на Re: Running query without trigger?  (Christian Elmerot <ce@one.com>)
Список pgsql-general
>> On 2016-07-09 08:20, hamann.w@t-online.de wrote:
>> > Hi,
>> >
>> > a table is associated with a trigger for normal use.
>> > An admin (someone with ALTER privilege) can disable tthe trigger, run some bulk update,
>> > and then re-enable it. This means, however, that  normal user activity has to be locked out.
>> >
>> > There are two possible scenarios: the bulk update would not cause trigger activity at all,
>> > because of the values and columns involved.
>> > or - the bulk update is followed by another bulk transaction that  is equivalent to trigger
>> > invocations per row.
>> > At least in the first case, running this particular query without triggering the trigger,
>> > but normal activity still going on, would be really great
>> > Is there a way to achieve this?
>> >
>> > Regards
>> > Wolfgang Hamann
>>
>> Well for temporary disabling triggers the easiest is to run:
>>      SET session_replication_role = replica;
>>      UPDATE ...
>>      SET session_replication_role = DEFAULT;
>>
>> This only affects the current session i.e. you and not any other
>> sessions which is what you seemed to require. All this assuming you run
>> a supported version of postgres
>>
>> Regards,
>> Christian Elmerot, Systems Engineer One.com
>>
Hello Christian,

thanks for the tip.
Out of the suggestions I got, specifying a list of relevant columns seems to be the best one
for my specific case. I believe your suggestion will be helpful in other - more ad hoc -
situations

Regards
Wolfgang






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

Предыдущее
От: Francisco Olarte
Дата:
Сообщение: Re: [BUGS] Where clause in pg_dump: need help
Следующее
От: hamann.w@t-online.de
Дата:
Сообщение: Re: Running query without trigger?