pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Bryn Llewellyn <bryn@yugabyte.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Christophe Pettus <xof@thebuild.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: User's responsibility when using a chain of "immutable" functions?
Date: Wed, 29 Jun 2022 02:29:38 -0400
Message-ID: <2997974.1656484178@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFj8pRAHhOB7bh=d6Od1qkYA=PktXqJFqyPORWmz-jQupJrAUA@mail.gmail.com>
References: <38FB5DA3-5940-43A9-8B09-5C856E2B18C4@yugabyte.com>
	<80C40450-6C0C-46E2-AE82-E7D46120F7FF@thebuild.com>
	<CAKFQuwbSo0z9aAq-Jok+aHoJvs+FhqTwHzz0Zu0ECTMAd=1NSQ@mail.gmail.com>
	<F0219B86-511C-45DC-8C85-C7B8A1AE96D7@yugabyte.com>
	<CAFj8pRCgAGvRGSNFX2FeSrVfi+DQ5rc+MebTLCuydhyuecMJLw@mail.gmail.com>
	<2987095.1656481562@sss.pgh.pa.us>
	<CAFj8pRAHhOB7bh=d6Od1qkYA=PktXqJFqyPORWmz-jQupJrAUA@mail.gmail.com>

Pavel Stehule <pavel.stehule@gmail.com> writes:
> st 29. 6. 2022 v 7:46 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
>> ... that result has discouraged most people from spending much
>> time on mechanically checking such things.  If you declare a function
>> immutable, Postgres will believe you; the consequences if you lied
>> are on your own head.

> We cannot ensure that the function is immutable, but we can detect that the
> function is not very probably immutable (in execution time).

Sure, there are a lot of easy cases where we could say "that's
obviously not immutable".  But is it worth spending engineering
effort and runtime on that?  I suspect the cases that people
might actually mess up are less obvious, so that we might
accomplish little more than offering a false sense of security.

			regards, tom lane





view thread (17+ messages)  latest in thread

Message-ID: <2997974.1656484178@sss.pgh.pa.us>
Permalink:  ../2997974.1656484178@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2997974.1656484178@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, pavel.stehule@gmail.com, bryn@yugabyte.com, david.g.johnston@gmail.com, xof@thebuild.com
  Subject: Re: User's responsibility when using a chain of "immutable" functions?
  In-Reply-To: <2997974.1656484178@sss.pgh.pa.us>
  References: <38FB5DA3-5940-43A9-8B09-5C856E2B18C4@yugabyte.com> <80C40450-6C0C-46E2-AE82-E7D46120F7FF@thebuild.com> <CAKFQuwbSo0z9aAq-Jok+aHoJvs+FhqTwHzz0Zu0ECTMAd=1NSQ@mail.gmail.com> <F0219B86-511C-45DC-8C85-C7B8A1AE96D7@yugabyte.com> <CAFj8pRCgAGvRGSNFX2FeSrVfi+DQ5rc+MebTLCuydhyuecMJLw@mail.gmail.com> <2987095.1656481562@sss.pgh.pa.us> <CAFj8pRAHhOB7bh=d6Od1qkYA=PktXqJFqyPORWmz-jQupJrAUA@mail.gmail.com> <2997974.1656484178@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