Re: Strange behavior of function date_trunc

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Strange behavior of function date_trunc
Date: 2021-05-07 14:02:11
Message-ID: 8f74291a-0f7d-dc04-9419-cb6623343fe1@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David,

On 06.05.2021 17:28, David G. Johnston wrote:
> On Thu, May 6, 2021 at 6:44 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>
> This case is the reason we invented the "stable" attribute to begin
> with.  People have since misinterpreted it as authorizing caching of
> function results, but that's not what it was intended for.
>
>
> This is a good paragraph...if something like it gets added to the
> create function documentation mis-interpretations are likely to decrease.
>

I found additional details in the documentation. In particular about the
index scanning for stable functions:
https://www.postgresql.org/docs/13/xfunc-volatility.html

The link to this section there is in the create function page. Maybe
that's enough.

--
Pavel Luzanov
Postgres Professional: https://postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-05-07 14:57:37 Re: trigger impacting insertion of records
Previous Message Pavel Luzanov 2021-05-07 13:53:45 Re: Strange behavior of function date_trunc