Re: Range type bounds

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: Range type bounds
Дата
Msg-id CAKFQuwZANFfA+9n3CuNa8fC6o2b0h5D_OZ0tYmv4+XejfXkFrg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Range type bounds  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Range type bounds  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general

I guess what is confusing to me is the transition between the text mode and the constructor mode is not clear. In particular the page starts with examples using the constructor mode but then goes to explanations that actually apply to the text mode before getting back to explaining the constructor mode. 

They are contained in separate subsections of the documentation...the syntax described in each section only applies to that section.  The concept of empty doesn't apply to constructor functions at all.  

The part that is problematic is the overloaded use of empty to mean a range without bounds (a value) and a means to specify an infinite bound (an input).  Using "omitted" for the input case would probably add clarity.

I eventually figured it out. I just thought it might make it easier for others to make the distinction clearer.

Suggestions welcomed



All that said it is taken for granted that you cannot have an empty function
argument so ('val',) is invalid on its face.  The question becomes whether
you should use ('val','') or ('val',NULL).  The only place that is answered
is a single example.  It should be in the body of the text too.

Well I spend my time in Python for the most part so:

def test_fnc(a, b=None):
    print a, b

In [12]: test_fnc('a',)
a None

I will have to plead ignorance on C.

It gets to be very verbose if we try to anticipate cross-language differences and preemptively explain them away...

David J.

 

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Range type bounds
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Range type bounds