Nikolay Samokhvalov [EMAIL PROTECTED] writes:
I remember several cases when people (e.g. me :-) ) were spending some
time trying to find an error in some pl/pgsql function and the reason
lied in incorrect work with arrays (i.e. messages like index is out
of bounds and index cannot be negative
On 4/9/07, Tom Lane [EMAIL PROTECTED] wrote:
Nikolay Samokhvalov [EMAIL PROTECTED] writes:
As I can see here, when I ask for element that doesn't exist, the
database returns NULL for me. Maybe it's well-known issue (and
actually I understood this behaviour before), but strictly speaking it
On 4/10/07, Tom Lane [EMAIL PROTECTED] wrote:
Nikolay Samokhvalov [EMAIL PROTECTED] writes:
I remember several cases when people (e.g. me :-) ) were spending some
time trying to find an error in some pl/pgsql function and the reason
lied in incorrect work with arrays (i.e. messages like index
Nikolay Samokhvalov wrote:
On 4/10/07, Tom Lane [EMAIL PROTECTED] wrote:
Nikolay Samokhvalov [EMAIL PROTECTED] writes:
I remember several cases when people (e.g. me :-) ) were spending some
time trying to find an error in some pl/pgsql function and the reason
lied in incorrect work with
Thinking about XPath's output in cases such as 'SELECT xpath('/a', 'b
/');' I've realized that in such cases an empty array should be
returned (now we have NULL for such cases).
Why? Because database _knows_ that there is no element -- this is not
NULL's case (unknown).
Then I've examined how
Nikolay Samokhvalov [EMAIL PROTECTED] writes:
As I can see here, when I ask for element that doesn't exist, the
database returns NULL for me. Maybe it's well-known issue (and
actually I understood this behaviour before), but strictly speaking it
seems wrong for me: the database _knows_ that
Nikolay Samokhvalov wrote:
2. what should I do with XPath function? There is strong analogy
between its case and array's case in my mind... Should I leave NULLs,
or empty arrays are better?
Empty array appears to be correct. The fact that arrays don't appear to
work as you might like is a