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 1iiNi8-00065n-T8 for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 19:13:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iiNi7-0001Mb-KQ for pgsql-hackers@arkaria.postgresql.org; Fri, 20 Dec 2019 19:13:15 +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 1iiNi7-0001MP-7O for pgsql-hackers@lists.postgresql.org; Fri, 20 Dec 2019 19:13:15 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iiNi4-0003UK-AQ for pgsql-hackers@postgresql.org; Fri, 20 Dec 2019 19:13:14 +0000 Received: by mail-pf1-x442.google.com with SMTP id p14so5722273pfn.4 for ; Fri, 20 Dec 2019 11:13:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=u+kOH7Y2zAHnl7Ggi8LzunI0n3VNDyA0YWN4KE2/u8k=; b=HuxM9OpZfZ1PY+izmZSYEDInUWWOrpM36+TFJo+JK3ejFufb8Xe6Dw681QlpdoqNWp UJwlD+9FOk2wsPJkAVp1sHrmvlmGDTjU4g6QxpTWJEbPPrwgXZGiCg0bC2RP46dFOzvs yyNUPfGDf2nVLe3kyC997HBJ6vPR2Nov2ibvxQDRINLE/11MMbhZRzwZTi1R1J5iAD9W 6w2Q72YZgk7Xi3GNsONQhACas9CDJGqaevqALr7Y0F58tK6Zm1WVGdRAyPTWdcieBkgD y8Ds+2XLB+WIaeawUo3bYrQ82kWnypmawNIz8FhF6/T8AEatiWoxEIzrW8r4PxkwS1DI k+NQ== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=u+kOH7Y2zAHnl7Ggi8LzunI0n3VNDyA0YWN4KE2/u8k=; b=e5kckuijGtxM7/VNO7yyPuDKnFdVIzPspasCvfFvBc9A3lWu7SMBQ+n1QUmY3Njb1M AdcWwGAdimQPFwSvzaefUCbrM3fMfMMmWrhrL8jId8yBzbkC+0CAaowxlxT3yfDYwFHx qM1Q8abuwx7uioLbGtQb1B/EJ9XAXHEA5RlTcK9Uq4V2rqNxFQWHDATd0MM9uc5aOEYw yd205YF01W6Mws/uD0elrGsbZyFujuSuoGoVtQPEQtLjw6GgdnHRV5mDsszMOPcnHprT EyEVhD/w60P+uFDMFT+hQA+yRYZW9d/Db6T7wcF3742VOw54V+qDkPLjYlpZYZkLddGz tixg== X-Gm-Message-State: APjAAAV+dBGYQ86PaeQR6JMDa126w2D90uzbrAy9BEDhg9WoNRfEM/7C Kjx4dMqgQWxjLDF3JoIpTYbgtA== X-Google-Smtp-Source: APXvYqx6Xr6mCA73X4Iw0oBLPCXmuz/0SrHI5Z4FpNhgMrScijIPN+6wwm8XNp4liV1Rz6o1siV0SA== X-Received: by 2002:a62:8249:: with SMTP id w70mr17082880pfd.253.1576869190385; Fri, 20 Dec 2019 11:13:10 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([201.186.81.122]) by smtp.gmail.com with ESMTPSA id u7sm13292031pfh.128.2019.12.20.11.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 11:13:09 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id CCBA6300A78; Fri, 20 Dec 2019 16:13:06 -0300 (-03) Date: Fri, 20 Dec 2019 16:13:06 -0300 From: Alvaro Herrera To: Paul A Jungwirth Cc: Pavel Stehule , Jeff Davis , Pgsql Hackers Subject: Re: range_agg Message-ID: <20191220191306.GA9332@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191220174321.GA5956@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Dec-20, Alvaro Herrera wrote: > I am not convinced that adding TYPTYPE_MULTIRANGE is really necessary. > Why can't we just treat those types as TYPTYPE_RANGE and distinguish > them using TYPCATEGORY_MULTIRANGE? That's what we do for arrays. I'll > try to do that next. I think this can be simplified if we make the the multirange's pg_type.typelem carry the base range's OID (the link in the other direction already appears as pg_range.mltrngtypid, though I'd recommend renaming that to pg_range.rngmultitypid to maintain the "rng" prefix convention). Then we can distinguish a multirange from a plain range easily, both of which have typtype as TYPTYPE_RANGE, because typelem != 0 in a multi. That knowledge can be encapsulated easily in type_is_multirange and pg_dump's getTypes. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services