Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXsrd-0006W6-9k for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Nov 2019 20:15:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXsrc-00017m-2s for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Nov 2019 20:15:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXsrb-00017f-N9 for pgsql-hackers@lists.postgresql.org; Thu, 21 Nov 2019 20:15:39 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXsrV-0005ty-5d for pgsql-hackers@postgresql.org; Thu, 21 Nov 2019 20:15:39 +0000 Received: by mail-pj1-x1036.google.com with SMTP id s8so2001777pji.2 for ; Thu, 21 Nov 2019 12:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xLKFkkHKEW008doyctDeAp+VoLgqUrBypyWdHTiVxpU=; b=ZlHPriI6O7TZh0i8c6lVAvNUwTTjDsouRO6MUeid+EDeVmn6AY/kcFhF7loPjmiDeV gTjGzHmzTJCgDeHBG2mfTUsi41N7kAjWaFU9IRUbDSf6Mm83hvxU86ZCUUvAtJdivgCQ FBbEbBzHVQCzJlOCWWof1P+MzJbV2LO07XQ15wor4f5TakbLLcWCS+MYJnhbGoak5LBr /4ET/QZ2B/dTExMEW08eox84UPFdEHqReFX7xtuF4I4m7ewjlgQDNrLAMNBYMJ8z5wCl QbhKvHh1ZEBlX8jflR71+mVStsdwh5CqbebdeGMfrJzBNZ6Hpo1QAiAKb/OWKBCMaBId Ib2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xLKFkkHKEW008doyctDeAp+VoLgqUrBypyWdHTiVxpU=; b=q7WYBJGNnxFvUZ1R6NrHbUv0EwaOKpVpWof2Dtjwe0KfKui8stpZoIbXCouR9ybMkV y1moVi/10kfIs4j6fThRrW9GSZYI5B0a9yadHf6wgx7117RrZ+u2ZJoiTr1uqDpL+18b vi2QdKsuXuwfL4/yYaqiu+9Xgxbrmgwmnbu7JVsrpG7UL0hv1Y/U9zvQvqwsyFxLz6Rp 4Dnu22hwD/pAv8vc1k6+Gxy4luTTSV68j7/29RMpxykpsHQNGYibNwPN+3fzzqI1MnZG f/bjO4snTSNu/yYWWsMcc4wc+Ca7W6JOBHnFX0IblgOnJsulKSfw9TnmKMPDhNd8F+o8 8SFQ== X-Gm-Message-State: APjAAAXa8VtRVjf0sfF3qAex6EWK0TaGZKK+GPS+5jj6oDdDFsP6wCmO XtGHUoIWxuj800avdeUYtjVbEF3Ygb8= X-Google-Smtp-Source: APXvYqyIUrBML2RC2Rt84AJHtwcd33XQowAf1xz7qN4IVJE2Uy0i2vbzVBHpcpUWKsxmUhXd549UkA== X-Received: by 2002:a17:90a:be05:: with SMTP id a5mr900300pjs.73.1574367330187; Thu, 21 Nov 2019 12:15:30 -0800 (PST) Received: from [192.168.2.101] (static-50-53-109-254.bvtn.or.frontiernet.net. [50.53.109.254]) by smtp.googlemail.com with ESMTPSA id g4sm4402885pfh.172.2019.11.21.12.15.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Nov 2019 12:15:29 -0800 (PST) Subject: Re: range_agg To: Pavel Stehule Cc: Alvaro Herrera , Jeff Davis , Pgsql Hackers References: <20190926211349.GA3375@alvherre.pgsql> From: Paul Jungwirth Message-ID: <5b52f2f4-a0ec-76b1-8a73-98b8a7270bd6@illuminatedcomputing.com> Date: Thu, 21 Nov 2019 12:15:28 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/21/19 1:06 AM, Pavel Stehule wrote: > 2. I don't like introduction "safe" operators - now the basic operators > are doubled, and nobody without documentation will use @* operators. > > It is not intuitive. I think is better to map this functionality to > basic operators +- * and implement it just for pairs (Multirange, > Multirange) and (Multirange, Range) if it is possible > > It's same relation line Numeric X integer. There should not be > introduced new operators. If somebody need it for ranges, then he can > use cast to multirange, and can continue. > [snip] > 3. There are not prepared casts - > > postgres=# select int8range(10,15)::int8multirange; > ERROR:  cannot cast type int8range to int8multirange > LINE 1: select int8range(10,15)::int8multirange; >                                ^ > There should be some a) fully generic solution, or b) possibility to > build implicit cast when any multirange type is created. Okay, I like the idea of just having `range + range` and `multirange + multirange`, then letting you cast between ranges and multiranges. The analogy to int/numeric seems strong. I guess if you cast a multirange with more than one element to a range it will raise an error. That will let me clean up the docs a lot too. Thanks! -- Paul ~{:-) pj@illuminatedcomputing.com