Re: How to get an inclusive interval when using daterange

2018-04-03 Thread Paul Jungwirth
On 04/03/2018 09:40 AM, hmidi slim wrote: I tried insert into availability values ('product x', '[2018-02-02,2018-03-01]'::daterange); and I got the same result such as insert into availability values ('product x', daterange('2018-02-02', '2018-03-01', '[]'). Yes, those are equivalent ways of

Re: How to get an inclusive interval when using daterange

2018-04-03 Thread hmidi slim
HI, I tried* insert into availability values ('product x', '[2018-02-02,2018-03-01]'::daterange); *and I got the same result such as* insert into availability values ('product x', daterange('2018-02-02', '2018-03-01', '[]').*

Re: How to get an inclusive interval when using daterange

2018-04-03 Thread Adrian Klaver
On 04/03/2018 07:35 AM, hmidi slim wrote: I tried it and I got the same result. Tried what? -- Adrian Klaver adrian.kla...@aklaver.com

Re: How to get an inclusive interval when using daterange

2018-04-03 Thread hmidi slim
I tried it and I got the same result.

Re: How to get an inclusive interval when using daterange

2018-04-02 Thread Tom Lane
hmidi slim writes: > When I insert a data into this table I use this query: > insert into availability values ('product x', daterange('2018-02-02', > '2018-03-01', '[]') > So I get a period like this: [2018-02-02, 2018-03-02) Yup. > In my app I tried to subtract a day from the period when I got

How to get an inclusive interval when using daterange

2018-04-02 Thread hmidi slim
Hi, I have a table* availability* which contains 3 columns: * id, product_id and period_availability(type daterange).* When I insert a data into this table I use this query: insert into availability values ('product x', daterange('2018-02-02', '2018-03-01', '[]') So I get a period like this: [201