X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 01BE7D1B4E8 for ; Mon, 8 Sep 2003 16:36:13 +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 78305-06 for ; Mon, 8 Sep 2003 13:35:41 -0300 (ADT) Received: from varsoon.wireboard.com (www.wireboard.com [216.151.155.101]) by svr1.postgresql.org (Postfix) with ESMTP id 19577D1B50E for ; Mon, 8 Sep 2003 13:35:41 -0300 (ADT) Received: from doug by varsoon.wireboard.com with local (Exim 3.35 #1) id 19wOzJ-0005st-00; Mon, 08 Sep 2003 12:35:37 -0400 To: Andreas Pflug Cc: Tom Lane , pgsql-hackers@postgresql.org Subject: Re: plpgsql doesn't coerce boolean expressions to boolean References: <15403.1063035632@sss.pgh.pa.us> <3F5CAC68.30502@pse-consulting.de> From: Doug McNaught Date: 08 Sep 2003 12:35:37 -0400 In-Reply-To: Andreas Pflug's message of "Mon, 08 Sep 2003 18:20:56 +0200" Message-ID: Lines: 24 User-Agent: Gnus/5.0806 (Gnus v5.8.6) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/555 X-Sequence-Number: 43567 Andreas Pflug writes: > Tom Lane wrote: > > > > >2. Throw an error if the expression doesn't return boolean. > > > I'd opt for 2. > It's quite common that newer compilers will detect more bogus coding > than older ones. There might be existing functions that break from > this because they rely on the current "feature", but there are > probably others that will throw an exception, revealing bad coding > (and delivering correct results just by chance, I've seen this more > than once...) I agree, and option 2 also makes sure that "bad" code will fail cleanly, rather than possibly changing behavior and causing data loss/corruption. I agree with another poster that deprecation in 7.4 and removal in 7.5 might make sense. -Doug