Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 110E71E62E80 for ; Wed, 25 Apr 2012 07:33:25 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SMzXH-0003jK-PW for pgsql-bugs@postgresql.org; Wed, 25 Apr 2012 10:33:24 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SMzX5-0001sb-3u for pgsql-bugs@postgresql.org; Wed, 25 Apr 2012 10:33:11 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SMzX4-0004Is-FF for pgsql-bugs@postgresql.org; Wed, 25 Apr 2012 10:33:10 +0000 Date: Wed, 25 Apr 2012 10:33:10 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6612: Functions can be called inside CHECK statements To: pgsql-bugs@postgresql.org From: atrigent@ccs.neu.edu X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/137 X-Sequence-Number: 32888 The following bug has been logged on the website: Bug reference: 6612 Logged by: Ari Entlich Email address: atrigent@ccs.neu.edu PostgreSQL version: 9.1.2 Operating system: Windows? Description: = Seeing as Postgres does not allow sub-queries in CHECK constraints yet, it doesn't make any sense to me for it to allow function calls, since functions can perform queries. Additionally, if a function is called from a check constraint and that function executes a query, the change that caused the check constraint to fire does not appear to be "visible" to the query. Therefore, calling functions in check constraints does not have the ability to check whether that change is valid, making it mostly useless.