Re: Range type bounds

From: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Range type bounds
Date: 2014-11-26 20:34:35
Message-ID: CAKFQuwZANFfA+9n3CuNa8fC6o2b0h5D_OZ0tYmv4+XejfXkFrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-11-26 20:53:57 Re: Range type bounds
Previous Message Adrian Klaver 2014-11-26 20:11:56 Re: Range type bounds