Re: Backend dies when overloading + operator for bool

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: Jeff Davis <jdavis(at)wasabimg(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Backend dies when overloading + operator for bool
Date: 2000-12-19 21:08:52
Message-ID: 00121916085202.02217@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tuesday 19 December 2000 22:11, Jeff Davis wrote:
>
> create function bool_to_int(bool) returns int as 'select 1 as result
> where $1 union select 0 as result where not $1;' language 'sql';

This is an alternative way to make the bool_to_int, but it doesn't solve your
problem unless the union was causing a bug:

CREATE FUNCTION bool_to_int(BOOLEAN) RETURNS INTEGER AS '
SELECT CASE WHEN $1 THEN 1 ELSE 0 END AS result;
' LANGUAGE 'SQL';

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2000-12-19 22:51:35 Re: Re: Table name scope (was Re: [BUGS] Outer joins aren't working with views)
Previous Message Bill Bunting 2000-12-19 20:10:48 ResultSet.getTimestamp() Exception