Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VUd3X-0004zO-Mm for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Oct 2013 13:47:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VUd3W-0006hh-K8 for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Oct 2013 13:47:02 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VUPNT-0004c2-EB for pgsql-bugs@postgresql.org; Thu, 10 Oct 2013 23:10:43 +0000 Received: from smtp112.dfw.emailsrvr.com ([67.192.241.112]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VUPNP-00055F-MA for pgsql-bugs@postgresql.org; Thu, 10 Oct 2013 23:10:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp21.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id C3E722401A8; Thu, 10 Oct 2013 19:10:38 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp21.relay.dfw1a.emailsrvr.com (Authenticated sender: dwayne-AT-docketnavigator.com) with ESMTPSA id 4A554240393; Thu, 10 Oct 2013 19:10:38 -0400 (EDT) From: "Dwayne Towell" To: "'Bruce Momjian'" Cc: References: <20131010225931.GZ7092@momjian.us> In-Reply-To: <20131010225931.GZ7092@momjian.us> Subject: Re: BUG #8516: Calling VOLATILE from STABLE function Date: Thu, 10 Oct 2013 16:10:35 -0700 Message-ID: <1c4601cec60d$ed9bfaa0$c8d3efe0$@docketnavigator.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Content-Language: en-us Thread-Index: AQF/TCf0W13wZUyhjpENkvFb4VhrOQIFdSOJmn1WkZA= X-Pg-Spam-Score: 0.1 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org > According to the documentation, f() should be marked VOLATILE also, since > calling f() produces side effects. PostgreSQL does not give a warning (or > better yet, an error); I think it should. I think the answer is that function authors are required to prevent functions they mark as STABLE from calling VOLATILE functions. -- I understand it's an error (at least usually), my question/issue is why does PostgreSQL NOT give at least a warning when a programmer (probably accidentally) calls a VOLATILE function in one that he has specifically tagged as STABLE? The compiler has all the information to notify the programmer of a mistake, but isn't. This violates a fundamental principle of software engineering--take every opportunity to prevent errors. Dwayne -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs