pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Igal @ Lucee.org <igal@lucee.org>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Function Volatility Stable vs Immutable
Date: Mon, 24 Jun 2019 19:54:27 -0700
Message-ID: <fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org> (raw)
In-Reply-To: <CAKFQuwZ1JF7+cS2O5ZpepQrJavMAsRr5cUfW3wYQHEpeEddjLw@mail.gmail.com>
References: <8a4ed1a2-74de-0fa3-e2a2-7b68b60b0a4f@lucee.org>
	<CAKFQuwZ1JF7+cS2O5ZpepQrJavMAsRr5cUfW3wYQHEpeEddjLw@mail.gmail.com>

On 6/24/2019 7:38 PM, David G. Johnston wrote:
> On Mon, Jun 24, 2019 at 7:31 PM Igal @ Lucee.org <igal@lucee.org 
> <mailto:igal@lucee.org>> wrote:
>
>     If a function select data from a table, and the rows in the table may
>     change, would that function qualify for Immutable or does it have
>     to be
>     Stable?  I'm asking because according to the docs [1]: "An IMMUTABLE
>     function cannot modify the database and is guaranteed to return
>     the same
>     results given the same arguments forever".
>
>     So for the same arguments, the result would change only if the
>     data in
>     the table changes.  Does that mean that it violates the "forever"
>     clause
>     and therefore can be only marked as Stable and not Immutable?
>
>
> Yes
>
> Forever means beyond the lifetime of a single transaction and thus it 
> is possible for the changing of the table contents to impact the 
> return value of the function.

Thanks for clarifying, David.

Igal

view thread (3+ messages)

Message-ID: <fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org>
Permalink:  ../fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org/
Also on:    postgresql.org/message-id/fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org

 · 

reply

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: igal@lucee.org, david.g.johnston@gmail.com
  Subject: Re: Function Volatility Stable vs Immutable
  In-Reply-To: <fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org>
  References: <8a4ed1a2-74de-0fa3-e2a2-7b68b60b0a4f@lucee.org> <CAKFQuwZ1JF7+cS2O5ZpepQrJavMAsRr5cUfW3wYQHEpeEddjLw@mail.gmail.com> <fc4f4a3c-8aec-b559-a655-f76b43e7ee6a@lucee.org>

* 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