From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jian He <hejian.mark@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Fwd: range of composite types!
Date: Wed, 27 Apr 2022 01:26:00 -0400
Message-ID: <318628.1651037160@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMV54g228Aph5ZcVRPWo4C4rRGD_bgBdcAg+SztCaE1hsmpCvQ@mail.gmail.com>
References: <CAMV54g0Goi140BvjvVoGK3ZHqo0hAgqr8vBBVpa0aii7RJxKhw@mail.gmail.com>
<CAMV54g228Aph5ZcVRPWo4C4rRGD_bgBdcAg+SztCaE1hsmpCvQ@mail.gmail.com>
Jian He <hejian.mark@gmail.com> writes:
>> for that means the following sql queries should return* false:*
>> select mytyperange (
>> (1,'2022-01-01')::mytype,
>> (8, '2022-01-31')::mytype, '[]') @> (2, '2020-01-19')::mytype;
Why should that return false? The comparison rules for composites
say that you compare the first column, only if that's equal
compare the second, etc. Here, "2" is between "1" and "8" so
the contents of the second column don't matter.
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, hejian.mark@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Fwd: range of composite types!
In-Reply-To: <318628.1651037160@sss.pgh.pa.us>
References: <CAMV54g0Goi140BvjvVoGK3ZHqo0hAgqr8vBBVpa0aii7RJxKhw@mail.gmail.com> <CAMV54g228Aph5ZcVRPWo4C4rRGD_bgBdcAg+SztCaE1hsmpCvQ@mail.gmail.com> <318628.1651037160@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