Re: SQL:2011 PERIODS vs Postgres Ranges?

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: pj(at)illuminatedcomputing(dot)com
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL:2011 PERIODS vs Postgres Ranges?
Date: 2018-10-21 18:56:08
Message-ID: CAMsGm5f61Xn9N-ENOEncOpYQYP9DyCKtLGxdBo8MiVjWxVB3kQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 21 Oct 2018 at 14:18, Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
wrote:

> Also, just how strictly do we have to follow the standard? Requiring
> sentinels like '01 JAN 3000` just seems so silly. Could Postgres
> permit nullable start/end PERIOD columns, and give them the same
> meaning as ranges (unbounded)? Even if I forgot about ranges
> altogether, I'd sure love to avoid these sentinels.
>

We have "infinity" and "-infinity" values in our date and timestamp types:

https://www.postgresql.org/docs/current/static/datatype-datetime.html

I think this avoids the silliness with sentinel values.

For myself, I don't care about PERIOD etc. one bit. The "every new
capability gets its own syntax" model that SQL follows is very
old-fashioned, and for good reason. I'm happy with ranges and exclusion
constraints. But if we can provide an implementation of PERIOD that makes
it easier to port applications written for legacy database systems, it
might be worthwhile.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2018-10-21 19:10:55 Re: SQL:2011 PERIODS vs Postgres Ranges?
Previous Message Paul A Jungwirth 2018-10-21 18:17:44 SQL:2011 PERIODS vs Postgres Ranges?