Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsSMS-0004gz-3X for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Jun 2021 15:49:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lsSMQ-00049g-I4 for pgsql-hackers@arkaria.postgresql.org; Sun, 13 Jun 2021 15:49:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lsSMQ-00049Y-6l for pgsql-hackers@lists.postgresql.org; Sun, 13 Jun 2021 15:49:18 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lsSMJ-00066S-Mg for pgsql-hackers@lists.postgresql.org; Sun, 13 Jun 2021 15:49:17 +0000 Received: by mail-il1-x12c.google.com with SMTP id h3so10067269ilc.9 for ; Sun, 13 Jun 2021 08:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=o0kIvX23Tfxi+Pw6l+AXsVsOocnzqCDXjD8hd8xXQQw=; b=AMHUTAn2SOp9jWEQAl93J21uME+qeJKfiqF8yQ3TtWLTMpTxauflw/XHzyy12sdEDV u2q0ChtZX7rADPOwgESHjZcbV7ClDD4dvL9wUVLUKvnfR+JfTxNG9xpALz+OXkdlAdfc PK0NwETZR7qizAcogOXXihAqHsW0o/qWbo77tQt+FP8eaB2UhXIVOPPUjEn4dQHu/uJj xdnENm8OkHwAMycHj8iPMKAVSW4OVVjJFacxJQXzRUF0lyvBjvMIL6FiYhlI1tKOCfr6 0yg+4Tm6ntS/+n2qotj2tj3YN2/BYAB38oiFn/FEDC1gKwDuGtOVYdrw0ZmUn2pFIffL LI0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=o0kIvX23Tfxi+Pw6l+AXsVsOocnzqCDXjD8hd8xXQQw=; b=RpHKooY1/NQI4Z2dijYhtz46q32CsY3IglCi+JZubEBRyg4C7ngPSKDves89SAximH LIW0B1jhoWmItDttEE/VgJF2mcncbTYWa5H036SzjpcICtCIhBNeL0yi/phpUX/4kO5X VqnjsbZZSzmgR5NCqRSJlljFcG7ZprEGV6MkWujPsNR0cBNHZX+a/ecnlCL4S8o0Hk2a vRKXzJN5PurL0R3b9KTNS8KH6A9CblmuNuLhxxM/1hB1HuTIeWERrtmSmwmSwddskJQC ztBhGpL1FqOJtbj3hZtxuX8IFtzd9JYYnDqKqNWJNT0J8xqp+zWPfAxoo5QdwCpJyKOp jyKg== X-Gm-Message-State: AOAM5329XoVN3aFpGYj/zID6Fgr1kMeHNrVX3krZK17uZjaisq71XKVP GG5B/j2LHr/Q9cvUCZ9IbvWaWg== X-Google-Smtp-Source: ABdhPJxGLDbS/2CvIFz/8eqwKBNUuscbo+Ec2g6DGFlrpCrDJ4E4JJyeBml/um6+zwcqpqFPI98HTA== X-Received: by 2002:a92:d941:: with SMTP id l1mr10453507ilq.143.1623599349764; Sun, 13 Jun 2021 08:49:09 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y2sm6606204ila.82.2021.06.13.08.49.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Jun 2021 08:49:09 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id D9BF980094D; Sun, 13 Jun 2021 10:49:07 -0500 (CDT) Date: Sun, 13 Jun 2021 10:49:07 -0500 From: Justin Pryzby To: "Jonathan S. Katz" Cc: Zhihong Yu , Alexander Korotkov , Alvaro Herrera , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: unnesting multirange data types Message-ID: <20210613154907.GZ16435@telsasoft.com> References: <20210610220416.GJ16435@telsasoft.com> <20210611233017.GO16435@telsasoft.com> <3648e50c-eb0d-4d16-7194-1a1c62893726@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jun 13, 2021 at 11:25:05AM -0400, Jonathan S. Katz wrote: > On 6/13/21 10:57 AM, Zhihong Yu wrote: > > +/* Turn multirange into a set of ranges */ > > > > set of ranges: sequence of ranges > > I believe "set of ranges" is accurate here, as the comparable return is > a "SETOF rangetype". Sequences are objects unto themselves. > I believe the point was that (in mathematics) a "set" is unordered, and a sequence is ordered. Also, a "setof" tuples in postgres can contain duplicates. The docs say "The ranges are read out in storage order (ascending).", so I think this is just a confusion between what "set" means in math vs in postgres. In postgres, "sequence" usually refers to the object that generarates a sequence: | CREATE SEQUENCE creates a new sequence number generator. -- Justin