public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Jian He <[email protected]>
Cc: [email protected]
Subject: Re: Fwd: range of composite types!
Date: Wed, 27 Apr 2022 01:26:00 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMV54g228Aph5ZcVRPWo4C4rRGD_bgBdcAg+SztCaE1hsmpCvQ@mail.gmail.com>
References: <CAMV54g0Goi140BvjvVoGK3ZHqo0hAgqr8vBBVpa0aii7RJxKhw@mail.gmail.com>
	<CAMV54g228Aph5ZcVRPWo4C4rRGD_bgBdcAg+SztCaE1hsmpCvQ@mail.gmail.com>

Jian He <[email protected]> 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






view thread (3+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Fwd: range of composite types!
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox