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

2003-09-09 Thread R. van Twisk
I would suggest to throw a error, or at least a warning. This will FORCE people to program in the correct way. I also thought that 'IF $1 THEN ...' should work ok but giving it a other thought it's indeed stuped to write that way (I'm from the C world...) Ries -Oorspronkelijk bericht- V

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,