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 1lpDsz-0007Xo-5I for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 17:45:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lpDsy-0002w6-46 for pgsql-general@arkaria.postgresql.org; Fri, 04 Jun 2021 17:45:32 +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 1lpDsx-0002vg-NH for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 17:45:31 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lpDsn-0000ZT-6N for pgsql-general@lists.postgresql.org; Fri, 04 Jun 2021 17:45:30 +0000 Received: by mail-pj1-x102e.google.com with SMTP id o17-20020a17090a9f91b029015cef5b3c50so7851642pjp.4 for ; Fri, 04 Jun 2021 10:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+x38xxguzwTONdNIL1rzs+armnoKpuj/y9NK+eOx7Cs=; b=0t+OCqu3fEM6n23PK+y99hNx21wyrJ/FGstnnOhXlFU15ZAV5JtqauJ5ZC+P0rXU24 ZL9at2nhW9FcL/0bFCY/XSJcmso0Pk9ncKhuM+W00vDjDp78oRV1FAY0PFSpXpbgmJpX hdMSQRPPbFCnPbCnT7Jl/cmIBXBLZ5wgX/WRO5HCpnimBxVblH7gJK4BileSbKliGnuR UL/tYFwHXcOCaiMF3SGJ3+3x+bVkv4ZMTvnmk/vYgReDe6xiur1zqMpPL+E9y/8044Vs 3NvCNP4sWewCmx8SkaYET+u1gqgiQGEsA4h3TBYZ1dOZthBQ10SU/Vle4w1fEdSiluw8 Uy+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=+x38xxguzwTONdNIL1rzs+armnoKpuj/y9NK+eOx7Cs=; b=dHz3oEq1/oZJLwjOndTcIPpHBI/4MhWO51g5fg7DkgrNk//I5qjfdvlF42LTe/6Ab8 TjeB06ELCVEd7vmAgzZv0uM+oA4rF0i7KottRG65BPIFMZ8d6g5zCk+F2rrxdOBCfx0d hHTVe9lztBpo9SqMVX392+clAk6UyaB1eeIOzdm0DkJK9R8tameF/K86eArP2ZyQYdX5 YJPPBWq+uWfZeAf8GiXzuL0eqLrDHiwL/l7I+RiVyZ1f0ztZmJCDQW4OwLRR0VtnyAGE kCjYybtEhcT6naIqp2gb8RfUOjv3pvr90fRc87cGMqa05vuy+h8iCMdI5f3psLL1vQK2 q4qw== X-Gm-Message-State: AOAM532duoJtiSKX+jnglY3xqLcn/BNq1/LkUr++mZA//SXxsshe8OBZ rDVZpEyKL0AZOpZDtcKQuUdSYzkgdWccaRjV6GwyyB2IIZnGSO7e6g4ah6YqFaVOOFTSJYS8JRq fAm70k6jC4egN/jyy/HpdFMADB1SofpMYJRur1a7w21vdpMw+GJGEFvswAOUCn4tMugSdZxjTjn d1ylxOzIDadoXF9hFQtrha8l6r7ro00skE03T3exjcRQ9SSch0dx0F X-Google-Smtp-Source: ABdhPJwEAuGMgaYb+Qk7s25pK2d7on59T8wz67j2ubJexH9rpWM6qOeFFqbwYpk8HmI0o93Ke2JIlQ== X-Received: by 2002:a17:902:ed41:b029:102:d012:e432 with SMTP id y1-20020a170902ed41b0290102d012e432mr5523204plb.61.1622828719868; Fri, 04 Jun 2021 10:45:19 -0700 (PDT) Received: from [192.168.0.29] (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id o9sm5184393pjp.51.2021.06.04.10.45.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jun 2021 10:45:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: Struggling with EXCLUDE USING gist From: Mark Dilger In-Reply-To: Date: Fri, 4 Jun 2021 10:45:13 -0700 Cc: postgre Content-Transfer-Encoding: quoted-printable Message-Id: <3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com> References: To: Laura Smith X-Mailer: Apple Mail (2.3608.120.23.2.4) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 4, 2021, at 9:47 AM, Laura Smith = wrote: >=20 > CREATE TABLE test ( > t_val text not null, > t_version text unique not null default gen_random_uuid() , > t_range tstzrange not null default tstzrange('-infinity','infinity'), > EXCLUDE USING gist (t_val WITH=3D, t_range WITH &&) DEFERRABLE = INITIALLY DEFERRED > ); > INSERT INTO test(t_val) values(p_val); This will insert a t_range of ('-infinity','infinity'), won't it? = Wouldn't you want to instead insert with t_range starting around now() = rather than starting at -infinity? =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company