Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qolIq-002mW4-Jd for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 13:55:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qolIo-007X1B-0W for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Oct 2023 13:55:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qolIn-007X13-Lt for pgsql-hackers@lists.postgresql.org; Fri, 06 Oct 2023 13:55:38 +0000 Received: from box.treelet.email ([3.66.149.70]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qolIh-000K1d-Tw for pgsql-hackers@lists.postgresql.org; Fri, 06 Oct 2023 13:55:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=treelet.net; s=mail; t=1696600530; bh=5l0bxmg3pdJAjHjnqjoO8rrl7fL0w169oeTaz2i+3mc=; h=From:Subject:Date:To:From; b=tUcoxnSnS5sC0Z7R1uMgv6Vj/FCC0pmHomDdcxzs/bvzWduOe1B7G6WVTOns4JbJb G9KnWEkSSAs2SU7TVTuVCHQJdE1Swyj7ldU+XF34OPqpG1gnZYDSI/0iE2J3K+EDk5 k7bhsVaeuYsEpud1mxNvgM57OQiN727tG5wBt5krWQQYHyEcKyEH0NEDLrOpAEBVyG xwEJWluR62cPX4zwuv2x0XyLdeP828nvOpftcH8auasg6Pa/KGW2n6izUpCKXVQcB4 aJZEttBA+YTXqfvUEObeNpRX6+cYeFvN35DF4YR32ThW+OeSOl0tXnA23Xk3CSWgCK gzvSRR8H8ow1g== Received: from authenticated-user (box.treelet.email [3.66.149.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by box.treelet.email (Postfix) with ESMTPSA id E6A003F40C for ; Fri, 6 Oct 2023 16:55:29 +0300 (EEST) From: "Rares Pop (Treelet)" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Custom tstzrange with importance factored in Message-Id: <8CB43014-79BC-4FA4-9838-A17313D525F9@treelet.net> Date: Fri, 6 Oct 2023 16:55:18 +0300 To: pgsql-hackers@lists.postgresql.org List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, I want to make a custom range (and multirange type) that carries a few = useful details.=20 Looks like I may have to implement the operators, custom functions and = my own aggregator. Where can I find the code SQL code for anything that relates to the = tstzrange range type? Or would you recommend a different approach? I essentially want to be able to aggregate multiple tstzranges - each = range with its own importance. The aggregation would be like a a = join/intersect where ranges with higher importance override the ones = with lower importance. Thanks! Rares=