From: Tom Lane <tgl@sss.pgh.pa.us>
To: Олег Самойлов <splarv@ya.ru>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: stable for each row before insert trigger
Date: Fri, 18 Oct 2019 09:15:58 +0200
Message-ID: <27662.1571382958@sss.pgh.pa.us> (raw)
In-Reply-To: <925B864A-0C60-4A2A-9072-88FB5501323F@ya.ru>
References: <925B864A-0C60-4A2A-9072-88FB5501323F@ya.ru>
=?utf-8?B?0J7Qu9C10LMg0KHQsNC80L7QudC70L7Qsg==?= <splarv@ya.ru> writes:
> According to documentation the words "VOLATILE, STABLE, IMMUTABLE" is somehow useful with trigger functions, for instance mentioned that the AFTER INSERT trigger should be VOLATILE. The question is how this words affect a for each row before insert trigger? Can be some optimisation here?
Where did you read that? There's no optimization that considers the
volatility of trigger functions --- they'll be called exactly when
specified, no more or less.
There are some PLs that might behave differently depending on whether they
think the function is volatile or not, but that's independent of whether
the function is a trigger.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, splarv@ya.ru
Subject: Re: stable for each row before insert trigger
In-Reply-To: <27662.1571382958@sss.pgh.pa.us>
References: <925B864A-0C60-4A2A-9072-88FB5501323F@ya.ru> <27662.1571382958@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox