Where is the tsrange() function documented?

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Where is the tsrange() function documented?
Date: 2021-10-19 03:44:40
Message-ID: 99FD2C6D-BF59-4D80-8335-5E67E5EA1750@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I found my way to this by guesswork and good luck. (I happen to be using PG Version 13.5. But I don't suppose that this matters.)

Doing "\df tsrange()" gives this:

Schema | Name | Result data type | Argument data types | Type
------------+---------+------------------+----------------------------------------------------------------+------
pg_catalog | tsrange | tsrange | timestamp without time zone, timestamp without time zone | func
pg_catalog | tsrange | tsrange | timestamp without time zone, timestamp without time zone, text | func

And doing this:

\x on
with c as (
select
'2000-01-15'::timestamp as t1,
'2000-05-15'::timestamp as t2)
select
tsrange(t1, t2, '[]') as r1,
tsrange(t1, t2, '[)') as r2,
tsrange(t1, t2, '(]') as r3,
tsrange(t1, t2, '()') as r4
from c;
\x off

gives this:

r1 | ["2000-01-15 00:00:00","2000-05-15 00:00:00"]
r2 | ["2000-01-15 00:00:00","2000-05-15 00:00:00")
r3 | ("2000-01-15 00:00:00","2000-05-15 00:00:00"]
r4 | ("2000-01-15 00:00:00","2000-05-15 00:00:00")

It's exactly what I was looking for. Now I want to refer colleagues to the PG doc on the tsrange() function.

But I can't formulate a search that finds it using the doc site's intrinsic search.

And I can't even find a single example of it on any site using Google.

Where is it?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2021-10-19 03:45:39 JSON query
Previous Message Chris Williams 2021-10-19 03:39:33 Re: Unsynchronized parallel dumps from 13.3 replica produced by pg_dump