From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-sql@hub.org
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
Date: Thu, 27 Jan 2000 12:52:37 -0500
Message-ID: <5406.948995557@sss.pgh.pa.us> (raw)
In-Reply-To: <200001271637.LAA23266@candle.pha.pa.us>
References: <200001271637.LAA23266@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Could you try the follwoing patch ?
> Hiroshi, I don't see this in the main tree, nor do I see it having been
> requested for application. Should I apply it?
If this does fix things, I would venture that the blame really belongs
to whatever caller of the comparison function is failing to interpret
the return value correctly ...
BTW there is a somewhat-related issue that has been bothering me:
the system is pretty erratic about converting between Datum and bool.
Some places use "DatumGetInt32(datum) != 0" as their effective test
for whether a Datum value is "true", some places use
"DatumGetInt8(datum) != 0", some places just do "(bool) datum", and
there may be other variants.
I am thinking of introducing DatumGetBool and BoolGetDatum macros and
trying to make the code use those uniformly, but there's a lot of code
to clean up. I was intending to do it during the function manager
interface rewrite, since all these same places will need to be looked
at for that.
Perhaps we should also try to clean up btree's sort comparison functions
in the same way, with some macros that provide a well-defined conversion
between Datum and the "<", "=", ">" return conditions that are intended.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, Inoue@tpf.co.jp, pgsql-sql@hub.org, pgsql-hackers@postgreSQL.org
Subject: Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4
In-Reply-To: <5406.948995557@sss.pgh.pa.us>
References: <200001271637.LAA23266@candle.pha.pa.us> <5406.948995557@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox