, 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.
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
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
Joe Conway wrote:
Tom Lane wrote:
I think he's got a good point, actually. We document the ARRAY-with-
parens-around-a-SELECT syntax as
The resulting one-dimensional array will have an element for
each row in the subquery result, with an element type matching
that of the
Bruce Momjian wrote:
Joe Conway wrote:
Any thoughts on how this should be handled for an empty 1D array?
No one responed to this email, so I will try. Is this the one
dimmentional array you were talking about?
test= select array_dims('{}'::integer[]);
array_dims
Joe Conway wrote:
Bruce Momjian wrote:
Joe Conway wrote:
Any thoughts on how this should be handled for an empty 1D array?
No one responed to this email, so I will try. Is this the one
dimmentional array you were talking about?
test= select array_dims('{}'::integer[]);
Tom Lane wrote:
I think he's got a good point, actually. We document the ARRAY-with-
parens-around-a-SELECT syntax as
The resulting one-dimensional array will have an element for
each row in the subquery result, with an element type matching
that of the subquery's
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
O Joe Conway May 23, 2005 :
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? NULL is what
you'd get for other data types -- for example:
One could ask in the same
Hi,
why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of
ARRAY[] resp. '{}'?
Markus
--
Markus Bertheau [EMAIL PROTECTED]
signature.asc
Description: This is a digitally signed message part
Markus Bertheau wrote:
Hi,
why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of
ARRAY[] resp. '{}'?
Markus
Perhaps Arrays always have to contain at least one element? (I don't
know for sure.)
SELECT array[];
ERROR: syntax error at or near ] at character 14
LINE 1: SELECT
Dnia 23-05-2005, pon o godzinie 18:54 +, Jan B. napisa(a):
Perhaps Arrays always have to contain at least one element? (I don't
know for sure.)
They can:
template1=# select '{}'::TEXT[];
text
--
{}
(1 )
I don't know, why the ARRAY[] syntax doesn't work for empty arrays.
Markus
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. We document the ARRAY-with-
13 matches
Mail list logo