Re: [HACKERS] int8 and index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
Cc: "Bruce Momjian" <maillist(at)candle(dot)pha(dot)pa(dot)us>, t-ishii(at)sra(dot)co(dot)jp, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] int8 and index
Date: 1999-09-27 13:29:31
Message-ID: 26000.938438971@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
> int4 -> int8 never fails.
> But int4 -> int2 fails if abs(int4) > 32768.

> select .. from .. where int2_column = 32769;

> should return 0 rows or cause an elog(ERROR) ?

Should return 0 rows, clearly. (That's what happens now, and I can
see no justification for doing otherwise.) When we add code to try to
coerce the constant to match the type of the column, we will have to
watch out for overflow and not do the coercion if so.

What would be really way cool would be if the constant simplifier could
recognize that this condition is a constant FALSE, but that would
probably mean building in more knowledge about the semantics of
specific operators than is justified...

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-09-27 13:34:13 Re: [HACKERS] double opens
Previous Message Tom Lane 1999-09-27 13:20:26 Re: [HACKERS] Frustration