Why 'infinity' is not in range '[2019-01-02, infinity]'?

2019-04-29 Thread PG Doc comments form
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/11/rangetypes.html Description: Hi. May I read this: But [today,infinity] means something different from [today,infinity) — the latter excludes the special timestamp value infinity. as B

Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?

2019-04-29 Thread Jonathan S. Katz
On 4/29/19 12:12 PM, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/11/rangetypes.html > Description: > > Hi. > > May I read this: > > But [today,infinity] means something different from [today,infinity

Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?

2019-04-29 Thread Eugen Konkov
1. Also I found next ambiguous part: select upper_inf( '["2018-08-14","Infinity")'::daterange ); Thanks jstag from IRC for explanation that unbound and infinite are different essence. Thus, on the page https://www.postgresql.org/docs/11/functions-range.html lower_inf(anyrange) bool

Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?

2019-04-29 Thread Tom Lane
Eugen Konkov writes: > if you allow I will suggest to map/convert 'infinity' value to > unbound range, for datatypes which defines 'infinity' value. That was intentionally rejected in the original range types design, and even if we thought that decision was wrong, it's too late to change it no

Re: COALESCE doccumentation

2019-04-29 Thread Bruce Momjian
On Sat, Apr 27, 2019 at 08:26:57PM +, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/11/functions-conditional.html > Description: > > The documentation says: > > "The COALESCE function returns the fi

Re: COALESCE doccumentation

2019-04-29 Thread Tom Lane
Bruce Momjian writes: > On Sat, Apr 27, 2019 at 08:26:57PM +, PG Doc comments form wrote: >> Try, for example. >> >> SELECT COALESCE(NULL, '12', 3, 1, 1); -- OK! >> SELECT COALESCE(NULL, '12.2', 3.2, '1', 1.1); -- OK! >> SELECT COALESCE(NULL, '1d2', 3, 1, 1); -- error >> SELECT COALESCE(NULL

Re: COALESCE doccumentation

2019-04-29 Thread Daniil Treshchin
Hi Bruce, David. Comment: "Without further elaboration as to the shortcomings" I provided a clear description on why, but for some reason it was missed in this thread. Here it is: The COALESCE(, ..., ) scans the list of s from left to right, determines the highest data type inthe list and ret

Re: COALESCE doccumentation

2019-04-29 Thread Daniil Treshchin
Oh, I was just playing a little bit with it to make sure how it works with some nesting involved. SELECT COALESCE(NULL, '12', '3', 1.2, (SELECT (CASE WHEN profile_code = 'abc' THEN '2d' ELSE '2d' END) FROM profile LIMIT 1)); -- failSELECT COALESCE(NULL, '12', '3', 1.2, (SELECT (CASE WHEN profi