Re: [patch,rfc] binary operators on integers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Marko Kreen <marko(at)l-t(dot)ee>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [patch,rfc] binary operators on integers
Date: 2000-10-12 19:34:05
Message-ID: Pine.LNX.4.21.0010122122080.12683-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Well, what are we going to do with this? I think we should take it.
Since I encouraged him to write it, I'd volunteer to take care of it.

We might want to change the bitxor operator to # (or at least something
distinct from ^) as well, for consistency.

Marko Kreen writes:

>
> Well, I was interested in binary operators on integers
> and as Peter suggested that I should look into it
> myself, so I did it.
>
> Choice of operators:
>
> ~ - not
> & - and
> # - xor - I like it :)
> | - or
>
> Things I am unsure of:
>
> 1) Precedence. I quite nonscientifically hacked in gram.y,
> and could not still make it understand expression '5 # ~1'
> nor the precedence between '&' and '|#'...
>
> At the moment all the gram.y changes could be dropped and
> it works ok, but without operator precedence. Any hints?
>
> 2) Choice of oids. I took 1890 - 1913. Should I have taken
> directly from 1874 upwards, or somewhere else?
>
> 3) Choice of operators. As I understand the '^' is taken,
> I wont get it. Now, in gram.y I found that the '|' is
> used in weird situations and with weird precedence so
> maybe I should use something else for OR too?
>
> 4) Is anybody else interested? ;)
>
>
> I would like to get comments/further hints on this...

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2000-10-12 19:45:45 Re: possible constraint bug?
Previous Message Alfred Perlstein 2000-10-12 19:32:43 Re: pg_dump possible fix, need testers. (was: Re: pg_dump disaster)