Can someone comment on this?
> Here is my next take on binary operators for integers.
> It implements the following operators for int2/int4/int8:
> ~ - not
> & - and
> ^ - xor
> | - or
> << - shift left
> >> - shift right
> * My original choice for xor was '#' because the '^' operator conflicts
> with power operator on floats but Tom Lane said:
> > Well, you *could* use '^' since there's no definition of it for integer
> > operands. But that would mean that something like '4^2', which was
> > formerly implicitly coerced to float and interpreted as floating
> > power function, would suddenly mean something different. Again a
> > serious risk of silently breaking applications. This doesn't apply to
> > '|' though, since it has no numeric interpretation at all right now.
> As the bit-string uses '^' too for xor-ing it would be nice to be
> consistent. I am quite unsure on this matter. The patch now seems
> otherwise sane to me, this is the only issue left.
> * On << and >> the second argument is always int32 as this seems
> to be the 'default' int type in PostgreSQL.
> * Oids used are 1874 - 1909.
> Patch is against current CVS.
[ Attachment, skipping... ]
Bruce Momjian | http://candle.pha.pa.us
pgman(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
pgsql-hackers by date
|Next:||From: Bruce Momjian||Date: 2000-10-17 04:02:22|
|Subject: Re: [COMMITTERS] pgsql/src/backend/utils/adt (formatting.c oracle_compat.c)|
|Previous:||From: Tom Lane||Date: 2000-10-17 04:00:24|
|Subject: Re: The lightbulb just went on... |
pgsql-patches by date
|Next:||From: Tom Lane||Date: 2000-10-17 04:07:32|
|Subject: Re: binary operators on integers |
|Previous:||From: Bruce Momjian||Date: 2000-10-17 03:42:49|
|Subject: Re: Network Patch to specify IP Address to Bind to|