Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread R. van Twisk
rspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Tom Lane Verzonden: maandag 8 september 2003 17:41 Aan: [EMAIL PROTECTED]; [EMAIL PROTECTED] Onderwerp: [SQL] plpgsql doesn't coerce boolean expressions to boolean Following up this gripe http://archives.postgresql.org/pgsql

Re: [HACKERS] [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Bruce Momjian
Tom Lane wrote: > Manfred Koizar <[EMAIL PROTECTED]> writes: > > On Mon, 08 Sep 2003 11:40:32 -0400, Tom Lane <[EMAIL PROTECTED]> > > 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 b

Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Richard Hall
Define the language! If it breaks code, so be it. 2. Throw an error if the _expression_ doesn't return boolean. Yes, yes, absolutely. By definition "an IF, WHILE, or EXIT statement is a boolean _expression_" SO     if "some stupid piece of text" THEN should not compile, there is no BOOLEAN _expre

Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Tom Lane
Manfred Koizar <[EMAIL PROTECTED]> writes: > On Mon, 08 Sep 2003 11:40:32 -0400, Tom Lane <[EMAIL PROTECTED]> > 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 constru

Re: [SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-09 Thread Manfred Koizar
On Mon, 08 Sep 2003 11:40:32 -0400, Tom Lane <[EMAIL PROTECTED]> 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,

[SQL] plpgsql doesn't coerce boolean expressions to boolean

2003-09-08 Thread Tom Lane
Following up this gripe http://archives.postgresql.org/pgsql-sql/2003-09/msg00044.php I've realized that plpgsql just assumes that the test expression of an IF, WHILE, or EXIT statement is a boolean expression. It doesn't take any measures to ensure this is the case or convert the value if it's no