Re: Running query without trigger?

From: "Charles Clavadetscher" <clavadetscher(at)swisspug(dot)org>
To: <hamann(dot)w(at)t-online(dot)de>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Running query without trigger?
Date: 2016-07-09 06:54:06
Message-ID: 00e601d1d9ae$b6040a30$220c1e90$@swisspug.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Good morning

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of hamann(dot)w(at)t-
> online.de
> Sent: Samstag, 9. Juli 2016 08:20
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] Running query without trigger?
>
>
> 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?

In general it helps better if you provide the version of PostgreSQL that you are using.

If you have a way to identify the bulk update from a record field, e.g. a timestamp or something like this, you may use WHEN to exclude them from firing the trigger. I am not sure if it is possible to use a condition other than using the fields of the old or new record.

https://www.postgresql.org/docs/current/static/sql-createtrigger.html

Regards
Charles

>
> Regards
> Wolfgang Hamann
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org) To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Berend Tober 2016-07-09 07:57:37 Re: Running query without trigger?
Previous Message hamann.w 2016-07-09 06:20:23 Running query without trigger?