Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Urgent, bool-to-int patch possible?

From: José Soares <jose(at)sferacarta(dot)com>
To: Matthew Hagerty <matthew(at)venux(dot)net>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Urgent, bool-to-int patch possible?
Date: 1999-04-15 13:19:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
create function int(bool) returns int as
        IF $1 THEN
            RETURN 1;
            RETURN 0;
        END IF;
' language 'plpgsql';

Matthew Hagerty ha scritto:

> Greetings,
> What would be the chances of getting a patch for 6.4.2 to do bool-to-int
> conversion?  I need to do a query similar to this:
> int(col1 > 3) + int(col2 < 4) + ... other conditions;
> (courtesy of Tom Lane)
> Would it be that hard to make a patch to do the conversion?  I would try it
> myself but I have no idea where to start looking, and I need this sooner
> than I could probably figure it out.
> I'm not making demands or stomping my feet, I love postgres and I
> understand that it is free software, but if one of you feels really nice... :)
> Thanks,
> Matthew

In response to

pgsql-interfaces by date

Next:From: Peter MountDate: 1999-04-15 13:42:49
Subject: RE: [INTERFACES] JDBC and Postgres
Previous:From: José SoaresDate: 1999-04-15 13:11:51
Subject: Re: [INTERFACES] Urgent, bool-to-int patch possible?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group