pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Terje Elde <terje@elde.net>
Cc: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Dwayne Towell <dwayne@docketnavigator.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8516: Calling VOLATILE from STABLE function
Date: Fri, 11 Oct 2013 10:48:36 +0200
Message-ID: <3117.1381481316@sss.pgh.pa.us> (raw)
In-Reply-To: <2798C998-40E6-4979-AD0A-64D744D015B7@elde.net>
References: <E1VU0qE-0003bl-7o@wrigleys.postgresql.org>
<20131010225931.GZ7092@momjian.us>
<1c4601cec60d$ed9bfaa0$c8d3efe0$@docketnavigator.com>
<20131010231546.GB7092@momjian.us>
<m27gdk6zny.fsf@2ndQuadrant.fr>
<2798C998-40E6-4979-AD0A-64D744D015B7@elde.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Terje Elde <terje@elde.net> writes:
> Would it be possible (and make sense) to solve this in a completely different way, not walking the function tree or doing static analysis, but simply setting and checking a bit during execution?
While it's possible that we could do something like that, I think it's
fairly unlikely that we would. The reason is that it would disable
constructs that some people find useful; that is, sometimes it's
intentional that a stable function calls a volatile one.
A couple of examples:
1. You might want to make some database updates but continue to do queries
with a pre-update snapshot. A single function can't accomplish that,
but the combination of a stable outer function with a volatile update
function can.
2. A security checking function (for use with Veil or the proposed row
security feature) might wish to log accesses without denying them. To
do that it'd have to be volatile, so if we had a restriction like this
the function would fail when invoked within a stable function.
You can imagine various ways around such issues, but it would add a lot
of complication.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
view thread (7+ messages)
Message-ID: <3117.1381481316@sss.pgh.pa.us> Permalink: ../3117.1381481316@sss.pgh.pa.us/ Also on: postgresql.org/message-id/3117.1381481316@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-bugs@postgresql.org Cc: tgl@sss.pgh.pa.us, terje@elde.net, dimitri@2ndQuadrant.fr, bruce@momjian.us, dwayne@docketnavigator.com Subject: Re: BUG #8516: Calling VOLATILE from STABLE function In-Reply-To: <3117.1381481316@sss.pgh.pa.us> References: <E1VU0qE-0003bl-7o@wrigleys.postgresql.org> <20131010225931.GZ7092@momjian.us> <1c4601cec60d$ed9bfaa0$c8d3efe0$@docketnavigator.com> <20131010231546.GB7092@momjian.us> <m27gdk6zny.fsf@2ndQuadrant.fr> <2798C998-40E6-4979-AD0A-64D744D015B7@elde.net> <3117.1381481316@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