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

2003-09-30 Thread Tom Lane
I said: > If we want to preserve this behavior for IF et al, I don't think there > is any practical way to apply SQL-level type coercion as I had wanted. > We could instead make the code act like it's assigning to a plpgsql > boolean variable --- but it will apply plpgsql's textual conversion > met

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

2003-09-28 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> if count(*) = 0 from Room where roomno = new.roomno then >> raise exception ''Room % does not exist'', new.roomno; >> end if; >> >> Is this really intended to be a feature? > I have to admit it was less an intention than more a side effec

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

2003-09-27 Thread Jan Wieck
Tom Lane wrote: Jan Wieck <[EMAIL PROTECTED]> writes: 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

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

2003-09-27 Thread Tom Lane
Jan Wieck <[EMAIL PROTECTED]> writes: > 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