Re: Range Types: << >> -|- ops vs empty range
| От | Josh Berkus |
|---|---|
| Тема | Re: Range Types: << >> -|- ops vs empty range |
| Дата | |
| Msg-id | 4D5579AC.4050707@agliodbs.com обсуждение исходный текст |
| Ответ на | Re: Range Types: << >> -|- ops vs empty range ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>) |
| Ответы |
Re: Range Types: << >> -|- ops vs empty range
Re: Range Types: << >> -|- ops vs empty range |
| Список | pgsql-hackers |
> "empty range"
> =============
> Zero length?
> If so, is it fixed at some point, but empty?
> '(x,x)'?
> '[x,x)'?
Neither of the above should be possible, I think. The expression "(x"
logically excludes the expression "x)".
However, "[x,x]" would be valid, and would be a zero-length interval at
the point "x".
> Is it everything?
> '[-inf,+inf]'?
No, that's "everything" which is a different concept. The above also
ought to be possible, and overlap everything.
> Is it really meaningfully distinct from NULL?
Yes. NULL means "I don't know". If a range type IS NULL, then any
operation performed with it ought to be NULL. Hence:
IF y > x, THEN:
[x,x] << [y,z) == TRUE
[x,x] -|- (x,y] == TRUE
NULL << [y,z} IS NULL
[-inf,+inf] << [y,z) == FALSE
I can imagine using all of these constructs in actual applications. In
fact, I have *already* used [-inf,+inf]
-- -- Josh Berkus PostgreSQL Experts Inc.
http://www.pgexperts.com
В списке pgsql-hackers по дате отправления: