Re: [HACKERS] Operator definitions

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Cc: Postgresql <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Operator definitions
Date: 1999-09-22 16:20:56
Message-ID: 199909221620.MAA07804@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> I've got a big problem: I had an operator defined as follows:
>
> CREATE OPERATOR ^ (
> leftarg = bit1,
> rightarg = bit1,
> procedure = bit1xor
> );
>
> and this was fine until 6.5.1, but in 6.5.2 I get
>
> ERROR: parser: parse error at or near "^"
>
>
> I've got the same problem with
>
> CREATE OPERATOR | (
> leftarg = bit1,
> rightarg = bit1,
> procedure = bit1or,
> commutator = |
> );
>
> but at least that didn't work under 6.5.1 either. Can anybody give me a
> hint how to fix this? I know nothing about the parser, or lex or yacc so
> I don't even know where to start. I need to fix this rather urgently ,
> as I have tons of plpgsql functions that make use of the ^ operator. At
> the moment I get a power for all of these which leads to pretty
> disastrous consequences :-(.
>
> If anybody can give me any hint at all, I'll have a go at fixing it.
> Much appreciated!

We do special things for ^ and | so it has proper precedence for

select 2 ^ 1*2
select 'asdf' | 'asdf' | 'asdf'

However, there were no changes I know of in 6.5.2 that would cause it to
break.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-22 16:39:14 Re: [HACKERS] postmaster disappears
Previous Message Thomas Lockhart 1999-09-22 15:48:29 Re: [DOCS] INSTALL file (was Re: [HACKERS] Re: HISTORY for 6.5.2)