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
'[1:0]
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
В Втр, 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
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('{}'
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:
> 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
> >
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 output
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
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
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-
parens-around
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:
regression=# SELECT (SELECT 1 WHERE FALSE) IS NULL;
?column?
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.
M
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
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
14 matches
Mail list logo