Re: Storing a time interval

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Michael Lewis <mlewis(at)entrata(dot)com>, stan <stanb(at)panix(dot)com>
Cc: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Storing a time interval
Date: 2019-11-08 20:12:59
Message-ID: 143433ed-b3f2-2749-4ae8-d282dcb7f3ce@aklaver.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/8/19 11:57 AM, Michael Lewis wrote:
> You certainly could choose to store as tstzrange, but why not use two
> fields?
>
> https://www.postgresql.org/docs/current/rangetypes.html

I would lean more to a composite type:

https://www.postgresql.org/docs/11/rowtypes.html

Range types are built around looking for values within the range,
whereas the OP is looking for two discrete values. The two field method
you suggest above also encapsulates that.

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message stan 2019-11-08 20:38:49 Re: Storing a time interval
Previous Message Michael Lewis 2019-11-08 19:57:00 Re: Storing a time interval