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 1lpEX3-0001Mm-4e for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 18:26:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lpEX2-0001qm-2L for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 18:26:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lpEX1-0001qe-GE for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 18:26:55 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lpEWz-0000rJ-4d for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 18:26:54 +0000 Received: by mail-qk1-x741.google.com with SMTP id r17so10238078qkp.10 for ; Fri, 04 Jun 2021 11:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joeconway.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=l6y9KT64CfepMy/t/6qc3utZEyROBJDQvw283l4WeDM=; b=C88Efqusv7L5WS07dbq2l2XcNgbpHSTKqy8s/slJKH3kqXy5SDh1TIm3/W1pTwJE8Y UOwcAXxYphLhY4ugSG8BkRmlpG+mFS0R2n/PdOCmUEJCRW3/t3eCbqP5EzSIshpcXt1q Mv5gcbbB6W60yoHDmydnLDMsAVT/97oyE4yaPpMQH4NvJJuzMEzF5RX7AgxERnuJ180S fGp3fDFNi+panlRsFWxoH5XEaXcoX+Z8siDwhyKQ1gDJKO5DiDG/opqp+XM6hkGM8FO5 p2E1+8q4JW2RtZrYDq/FRwSuA6CjV6v4gyVW5oQyXHUjzBBizk4Qy3FDbbpdSS0RKG/9 teqg== 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=l6y9KT64CfepMy/t/6qc3utZEyROBJDQvw283l4WeDM=; b=t6zBr/o/GhXcY3iVflt7eq2t7Qgu9JqN3kodxahg03t3l/PpotsgK6I8B3lPy6WxzW LH1OFbxFrSt3DBKNlP48S6W/rKEVPPxosvGcX9WRiki85Oyrpnc2QLrERbfvxEoWVqbP kTVeWZ8/kQ64kAvLqJlv+w0/++POS/1tfQ2ddRZgboesORDsj8UxZjwEc5Qbwmlqad9U bhjEyn3RfmSS7Xh30f9SCCILi2g5VNNfj3ny+zQ9iUeZQeHzXKO4c7sjj/gQm5ifNe8R 6lxiu8H263ElloqJIJcoGhLCdBXaMOG7CX45NMhwY0IGPZ4hV+nPZensOKg0ih6JD/yO 4H1w== X-Gm-Message-State: AOAM532Qh4FdtRYuR6aPwCANXf4umxTRjTWkh5yqh3AaYUQJztVTxL8c T+Uh0eOAeJKhLAdTa7W/N6D/3VoOFXzJXkbBpsnNb4I+q/sV9iMMlHapH4s4U82mHjuPb8z25B5 lFkKRiCwP34BlL7Tefya/SWzsc8nl5MRjySw8lsGlSz7dEdBnUnq+fI/w1lP32QU4g7xrAdpp8w tnu4MuoRqEX78ftA== X-Google-Smtp-Source: ABdhPJy+BVSlVvmUKicl4fjPYjfWhM9liVW+n513wjkkyg3y8d3bSX/3pTc0IeQ7lukK4jEZbE2idQ== X-Received: by 2002:a05:620a:24d3:: with SMTP id m19mr5729576qkn.230.1622831211439; Fri, 04 Jun 2021 11:26:51 -0700 (PDT) Received: from [192.168.4.41] (072-017-018-098.res.spectrum.com. [72.17.18.98]) by smtp.gmail.com with ESMTPSA id y20sm4363055qkm.5.2021.06.04.11.26.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 11:26:51 -0700 (PDT) Subject: Re: Struggling with EXCLUDE USING gist To: Laura Smith , Adrian Klaver Cc: postgre References: From: Joe Conway Message-ID: <541a4f52-3e11-1d75-741a-daa54b48af19@joeconway.com> Date: Fri, 4 Jun 2021 14:26:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/4/21 1:32 PM, Laura Smith wrote: > What is the solution then ? I need to keep historical versions but > at the same time I need a "current" version. If I am not able to use > "infinity" as bounds for "current" version then clearly I'm wasting > my time trying to use EXCLUDE AS for version tracking because clearly > using fixed timestamps instead of "infinity" for tstzrange would be a > hacky fix that will be fragile and prone to breakage. This is not exactly the same thing you are trying to do (I think), but maybe you can get some useful ideas from this: https://www.joeconway.com/presentations/RLS_TimeTravel-FOSDEM2019.pdf HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development