Range type bounds

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Range type bounds
Дата
Msg-id 54761F6E.6010900@aklaver.com
обсуждение исходный текст
Ответы Re: Range type bounds  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
I am trying out the range types:

http://www.postgresql.org/docs/9.3/interactive/rangetypes.html

and got confused by the documentation wording for specifying no lower or
upper bound:

"The lower-bound may be either a string that is valid input for the
subtype, or empty to indicate no lower bound. Likewise, upper-bound may
be either a string that is valid input for the subtype, or empty to
indicate no upper bound."

What I saw was this:

aklaver@test=> select daterange('2014-11-01'::date,) ;
ERROR:  syntax error at or near ")"
LINE 1: select daterange('2014-11-01'::date,) ;

aklaver@test=> select '[2014-11-01,)'::daterange;
    daterange
---------------
  [2014-11-01,)
(1 row)

aklaver@test=> select daterange('2014-11-01'::date, Null) ;
    daterange
---------------
  [2014-11-01,)
(1 row)

which when I got further into the docs was shown in this example:

8.17.6. Constructing Ranges

-- Using NULL for either bound causes the range to be unbounded on that
side.
SELECT numrange(NULL, 2.2);


I will leave it to philosophers to decide whether NULL is empty, but it
seems the documentation could be more explicit on what constitutes empty
in the text versus constructor method of creating a range.

Thanks,
--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Active/Active clustering in postgres
Следующее
От: Dev Kumkar
Дата:
Сообщение: Re: Lock Management: Waiting on locks