Extract dates of a given day

Поиск
Список
Период
Сортировка
От hmidi slim
Тема Extract dates of a given day
Дата
Msg-id CAMsqVxtCJzovZrXd17_cC-BoYC+JPGm38rmCH12o+fhrYX4bzg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Extract dates of a given day  (mariusz <marius@mtvk.pl>)
Re: Extract dates of a given day  (rob stone <floriparob@gmail.com>)
Список pgsql-general
Hi,
I have a table availability: id (integer), product varchar(255), period (daterange)
I want to extract dates from a given period matching a given day.
E.g:  for the period from 01/04/2018 - 30/04/2018 and for day = Monday I want to get
02/04/2018
09/04/2018
16/04/2018
23/04/2018
30/04/2018


I want to make a query such as (the query doesn't work ) but I want to extract dates from daterange type:
select * from availability
where period @> '[2018-04-02, 2018-04-20]'
and extract(dow from period_date) = 1

How can I extract dates from daterange?

В списке pgsql-general по дате отправления:

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: pg_basebackup or dump for starting replication process
Следующее
От: mariusz
Дата:
Сообщение: Re: Extract dates of a given day