Re: range_adjacent and discrete ranges
От | Jeff Davis |
---|---|
Тема | Re: range_adjacent and discrete ranges |
Дата | |
Msg-id | 1321635366.11794.47.camel@jdavis обсуждение исходный текст |
Ответ на | Re: range_adjacent and discrete ranges (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: range_adjacent and discrete ranges
|
Список | pgsql-hackers |
On Fri, 2011-11-18 at 10:33 -0500, Tom Lane wrote: > regression=# select int4range(4,4,'(]'); > ERROR: range lower bound must be less than or equal to range upper bound > regression=# select int4range(4,4,'()'); > ERROR: range lower bound must be less than or equal to range upper bound > > Would it be better for them to silently transform such cases to "empty"? That had crossed my mind, but I read the first as saying that it includes 4 and doesn't include 4, which is a little confusing. But I wouldn't object to making them return empty ranges. Seeing that we removed some other errors in favor of returning something, it might be a little more consistent to return empty when possible. I wouldn't like to extend that to int4range(4,3), however. When the upper bound is less than the lower bound, it's almost certainly a mistake, and the user should be informed. By the way, what does this have to do with canonical functions? This seems more like a constructor issue, and there is already a zero-argument constructor to make empty ranges. Regards,Jeff Davis
В списке pgsql-hackers по дате отправления: