Re: Help with writing a generate_series(tsmultirange, interval)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: François Beausoleil <francois(at)teksol(dot)info>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Help with writing a generate_series(tsmultirange, interval)
Date: 2021-08-01 01:30:51
Message-ID: 1403075.1627781451@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?utf-8?Q?Fran=C3=A7ois_Beausoleil?= <francois(at)teksol(dot)info> writes:
> While mowing the lawn, I thought that since the syntax of multi ranges is similar to arrays, maybe I could use unnest(), but sadly, that was not to be the case:
> # select unnest('{[2021-08-02,2021-08-04],[2021-08-07,2021-08-09)}'::tsmultirange);
> ERROR: function unnest(tsmultirange) does not exist

That's fixed for beta3:

regression=# select unnest('{[2021-08-02,2021-08-04],[2021-08-07,2021-08-09)}'::tsmultirange);
unnest
-----------------------------------------------
["2021-08-02 00:00:00","2021-08-04 00:00:00"]
["2021-08-07 00:00:00","2021-08-09 00:00:00")
(2 rows)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ayub M 2021-08-01 04:56:50 postgres vacuum memory limits
Previous Message Adrian Klaver 2021-08-01 00:34:31 Re: Help with writing a generate_series(tsmultirange, interval)