Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[]

2005-06-27 Thread Bruce Momjian
OK, what is the TODO item text? --- Joe Conway wrote: Bruce Momjian wrote: Is this a TODO item? Probably. I posted some questions regarding whether or not to break backward compatiblity, and received no replies.

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[]

2005-06-26 Thread Joe Conway
Bruce Momjian wrote: Is this a TODO item? Probably. I posted some questions regarding whether or not to break backward compatiblity, and received no replies. In the meanwhile, I've been doing a major system integration in Korea for the last 2 weeks, and won't get back to home, or to

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[]

2005-06-24 Thread Bruce Momjian
Is this a TODO item? --- Markus Bertheau ? wrote: ? ???, 06/06/2005 ? 08:58 -0700, Joe Conway ?: Joe Conway wrote: Actually, consistent with my last post, I think array_upper() on a zero-element array should

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-06-06 Thread Markus Bertheau ☭
, 24/05/2005 00:06 -0400, Tom Lane : Joe Conway [EMAIL PROTECTED] writes: Markus Bertheau wrote: why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of ARRAY[] resp. '{}'? Why would you expect an empty array instead of a NULL? I think he's got a good point, actually.

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-06-06 Thread Markus Bertheau ☭
, 06/06/2005 10:44 -0400, Tom Lane : Markus Bertheau =?UTF-8?Q?=E2=98=AD?= [EMAIL PROTECTED] writes: By analogy, array_upper('{}'::TEXT[], 1) should return 0 instead of NULL. No, that doesn't follow ... we've traditionally considered '{}' to denote a zero-dimensional array. But

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-06-06 Thread Tom Lane
Markus Bertheau =?UTF-8?Q?=E2=98=AD?= [EMAIL PROTECTED] writes: By analogy, array_upper('{}'::TEXT[], 1) should return 0 instead of NULL. No, that doesn't follow ... we've traditionally considered '{}' to denote a zero-dimensional array. A 1-D array of no elements is '[1:0]={}', just as Joe

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-06-06 Thread Joe Conway
Tom Lane wrote: Markus Bertheau =?UTF-8?Q?=E2=98=AD?= [EMAIL PROTECTED] writes: By analogy, array_upper('{}'::TEXT[], 1) should return 0 instead of NULL. No, that doesn't follow ... we've traditionally considered '{}' to denote a zero-dimensional array. A 1-D array of no elements is

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-06-06 Thread Joe Conway
Markus Bertheau wrote: , 06/06/2005 10:44 -0400, Tom Lane : Markus Bertheau =?UTF-8?Q?=E2=98=AD?= [EMAIL PROTECTED] writes: By analogy, array_upper('{}'::TEXT[], 1) should return 0 instead of NULL. No, that doesn't follow ... we've traditionally considered '{}' to denote a

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp.

2005-06-06 Thread Joe Conway
Joe Conway wrote: Actually, consistent with my last post, I think array_upper() on a zero-element array should return NULL. A zero-element array has a defined lower bound, but its upper bound is not zero -- it is really undefined. Just to clarify my response, this is what I propose:

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[]

2005-06-06 Thread Markus Bertheau ☭
, 06/06/2005 08:58 -0700, Joe Conway : Joe Conway wrote: Actually, consistent with my last post, I think array_upper() on a zero-element array should return NULL. A zero-element array has a defined lower bound, but its upper bound is not zero -- it is really undefined. Just to

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp.

2005-06-06 Thread Joe Conway
Markus Bertheau wrote: Hmm, this gets really complicated and inconsistent. Complicated means unusable. What about modifying the dimension syntax such that the second number means number of elements instead of upper bound? That particular problem would go away then, and

Re: [HACKERS] [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-05-24 Thread Markus Bertheau
Dnia 24-05-2005, wto o godzinie 00:06 -0400, Tom Lane napisa(a): Joe Conway [EMAIL PROTECTED] writes: Markus Bertheau wrote: why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of ARRAY[] resp. '{}'? Why would you expect an empty array instead of a NULL? I think he's got