Re: is array bug? (array[][])[] = NULL - Mailing list pgsql-bugs

From Tom Lane
Subject Re: is array bug? (array[][])[] = NULL
Date
Msg-id 27308.1086360400@sss.pgh.pa.us
Whole thread Raw
In response to is array bug? (array[][])[] = NULL  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
List pgsql-bugs
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
> I expect v1 = [1,2], but v1 is null.
> What is wrong?

Postgres arrays don't work that way; you're assuming the semantics are
like C which they aren't.

You could get an approximation to what you want with array slicing, viz
    v2[1:1][1:2]
but note that this doesn't decrease the dimensionality of the result.

            regards, tom lane

pgsql-bugs by date:

Previous
From: contact
Date:
Subject: build postgresql-7.4.2 fails: FATAL: semctl(35, 16, SETVAL, 536) failed: Inv,alid argument
Next
From: Tom Lane
Date:
Subject: Re: build postgresql-7.4.2 fails: FATAL: semctl(35, 16, SETVAL, 536) failed: Inv,alid argument