Re: EXCLUDE USING and tstzrange

From: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: EXCLUDE USING and tstzrange
Date: 2021-06-04 14:58:56
Message-ID: YscYLfnWRanpAjjw4JsUh94o95o7KuPD7ZNnhGVv6pTV5yiDZJRA-RevM_mJVsmlbV2HEH9zPEmZ7pSLp1wVfk5VkJMeilNEonA4Eenuac4=@protonmail.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, 4 June 2021 15:44, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:

> On 6/4/21 7:32 AM, Laura Smith wrote:
>
> > Hi,
> > I'm having difficulty finding the right part of the docs for this one.
> > Could someone kindly clarify:
> > create table test (
> > test_id text,
> > test_range tstzrange);
> > Will "EXCLUDE USING gist (test_id WITH =, test_range WITH && )" work as expected or do I need to use "EXCLUDE USING gist (test_id WITH =, test_range WITH TIME ZONE && )" to ensure the timezone is correctly taken into account during comparison ?
>
> tstzrange is over timestamp with time zone, so time zones are already
> taken into account.
>
> > Thanks !
> > Laura
>
> --
>
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com

Thank you Adrian !

One other question, what's the syntax for manipulating only the upper bound of a range.

Say I have a Postgres function that does a "SELECT INTO" for an existing tsrange. Is there an easy way to change the variable's upper bound whilst leaving the "old" lower bound intact ?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Atul Kumar 2021-06-04 15:10:30 Re: strange behavior of WAL files
Previous Message Adrian Klaver 2021-06-04 14:44:59 Re: EXCLUDE USING and tstzrange