pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Dilger <mark.dilger@enterprisedb.com>
To: Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch>
Cc: postgre <pgsql-general@lists.postgresql.org>
Subject: Re: Struggling with EXCLUDE USING gist
Date: Fri, 4 Jun 2021 10:45:13 -0700
Message-ID: <3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com> (raw)
In-Reply-To: <M6lJSlEwKoymv5VnRk4t2ENAnQAabdAWwbpzRIrw5mGEyel4Asda9xXTjYtZWFOuVYM6GFwGfYErqhYmpc9skrTA3FqZBCd_-LF2tw3yKiU=@protonmail.ch>
References: <M6lJSlEwKoymv5VnRk4t2ENAnQAabdAWwbpzRIrw5mGEyel4Asda9xXTjYtZWFOuVYM6GFwGfYErqhYmpc9skrTA3FqZBCd_-LF2tw3yKiU=@protonmail.ch>



> On Jun 4, 2021, at 9:47 AM, Laura Smith <n5d9xq3ti233xiyif2vp@protonmail.ch> wrote:
> 
> 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=, t_range WITH &&) DEFERRABLE INITIALLY DEFERRED
> );

<snip>

> 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?

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company








view thread (13+ messages)  latest in thread

Message-ID: <3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com>
Permalink:  ../3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com/
Also on:    postgresql.org/message-id/3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mark.dilger@enterprisedb.com, n5d9xq3ti233xiyif2vp@protonmail.ch
  Subject: Re: Struggling with EXCLUDE USING gist
  In-Reply-To: <3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com>
  References: <M6lJSlEwKoymv5VnRk4t2ENAnQAabdAWwbpzRIrw5mGEyel4Asda9xXTjYtZWFOuVYM6GFwGfYErqhYmpc9skrTA3FqZBCd_-LF2tw3yKiU=@protonmail.ch> <3694F477-58DD-4B8E-85A2-4B7BA97636D6@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox