X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 992A3D1B534 for ; Tue, 9 Sep 2003 15:39:31 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 29168-01 for ; Tue, 9 Sep 2003 12:39:21 -0300 (ADT) Received: from email02.aon.at (WARSL402PIP7.highway.telekom.at [195.3.96.94]) by svr1.postgresql.org (Postfix) with SMTP id 66B6ED1B52B for ; Tue, 9 Sep 2003 12:39:19 -0300 (ADT) Received: (qmail 172512 invoked from network); 9 Sep 2003 14:54:28 -0000 Received: from m155p031.dipool.highway.telekom.at (HELO cantor) ([62.46.9.95]) (envelope-sender ) by qmail2rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 9 Sep 2003 14:54:28 -0000 From: Manfred Koizar To: Tom Lane Cc: pgsql-hackers@postgresql.org, pgsql-sql@postgresql.org Subject: Re: plpgsql doesn't coerce boolean expressions to boolean Date: Tue, 09 Sep 2003 16:56:20 +0200 Message-ID: <2uorlv41aahh6fp3773r5pkjdnm26m4cc5@email.aon.at> References: <15403.1063035632@sss.pgh.pa.us> In-Reply-To: <15403.1063035632@sss.pgh.pa.us> X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/62 X-Sequence-Number: 15040 On Mon, 08 Sep 2003 11:40:32 -0400, Tom Lane wrote: >4. Use the parser's coerce_to_boolean procedure, so that nonbooleans > will be accepted in exactly the same cases where they'd be accepted > in a boolean-requiring SQL construct (such as CASE). (By default, > none are, so this isn't really different from #2. But people could > create casts to boolean to override this behavior in a controlled > fashion.) I vote for 4. And - being fully aware of similar proposals having failed miserably - I propose to proceed as follows: If the current behaviour is considered a bug, let i=4, else let i=5. In 7.i: Create a new GUC variable "plpgsql_strict_boolean" (silly name, I know) in the "VERSION/PLATFORM COMPATIBILITY" section of postgresql.conf. Make the new behaviour dependent on this variable. Default plpgsql_strict_boolean to false. Place a warning into the release notes and maybe into the plpgsql documentation. In 7.j, j>i: Change the default value of plpgsql_strict_boolean to true. Issue WARNINGs or NOTICEs as appropriate. Update documentation. In 7.k, k>j: Remove old behaviour and GUC variable. Update documentation. Servus Manfred