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.92) (envelope-from ) id 1jAgsg-0002n3-KS for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Mar 2020 21:21:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jAgsf-0001sS-7n for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Mar 2020 21:21:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jAgse-0001sI-Rz for pgsql-hackers@lists.postgresql.org; Sat, 07 Mar 2020 21:21:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jAgsZ-0008QT-JZ for pgsql-hackers@postgresql.org; Sat, 07 Mar 2020 21:21:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 027LKwcF016398; Sat, 7 Mar 2020 16:20:58 -0500 From: Tom Lane To: Paul A Jungwirth cc: Alvaro Herrera , Pavel Stehule , Jeff Davis , Pgsql Hackers Subject: Re: range_agg In-reply-to: <15764.1583615192@sss.pgh.pa.us> References: <20200304022849.GA5402@alvherre.pgsql> <13800.1583612399@sss.pgh.pa.us> <15764.1583615192@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sat, 07 Mar 2020 16:06:32 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16396.1583616058.1@sss.pgh.pa.us> Date: Sat, 07 Mar 2020 16:20:58 -0500 Message-ID: <16397.1583616058@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > Actually ... have you given any thought to just deciding that ranges and > multiranges are the same type? That is, any range can now potentially > contain multiple segments? That would eliminate a whole lot of the > tedious infrastructure hacking involved in this patch, and let you focus > on the actually-useful functionality. Also, this would allow us to remove at least one ugly misfeature: regression=# select '[1,2]'::int4range + '[3,10)'::int4range; ?column? ---------- [1,10) (1 row) regression=# select '[1,2]'::int4range + '[4,10)'::int4range; ERROR: result of range union would not be contiguous If the result of range_union can be a multirange as easily as not, we would no longer have to throw an error here. regards, tom lane