Re: Infix Function?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Peter Fein <pfein(at)pobox(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Infix Function?
Date: 2005-06-26 22:21:49
Message-ID: 20050626222145.GB2086@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jun 26, 2005 at 03:42:25PM -0500, Peter Fein wrote:
> Hi-
>
> I've defined an XOR function as:
>
>
> CREATE OR REPLACE FUNCTION xor(bool, bool)
> RETURNS bool AS
> 'SELECT ($1 OR $2) AND NOT ($1 AND $2);'
> LANGUAGE 'sql' IMMUTABLE STRICT;
>
> Is there anyway to create an infix version of this? I'd really like be
> able to write (where a..d are some boolean conditions):

Judging by:

http://www.postgresql.org/docs/7.4/interactive/sql-createoperator.html

operators can't be normal text strings...

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sean Davis 2005-06-26 23:02:43 Re: MacOSX, fink, missing readline/readline.h
Previous Message John DeSoi 2005-06-26 22:13:29 Re: MacOSX, fink, missing readline/readline.h