Re: one null value in array isnt allowed???

From: "Wappler, Robert" <rwappler(at)ophardt(dot)com>
To: "Armand Turpel" <aturpel(at)mnhn(dot)lu>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: one null value in array isnt allowed???
Date: 2010-03-29 10:58:13
Message-ID: C8E2DAF0E663A948840B04023E0DE32A0270C5FE@w2k3server02.de.ophardt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2010-03-29, Armand Turpel wrote:

> Hi,
>
> Updating an array field with one null value isnt possible:
>
> UPDATE table SET integer_array = ARRAY[NULL]
>

Try to specify an explicit type, e.g. ARRAY[NULL]::int[]

> But those queries are working:
>
> UPDATE table SET integer_array = ARRAY[NULL,1]
> UPDATE table SET integer_array = ARRAY[1,NULL]
>
> This dosent seems logical to me.
> Is it a bug?
>

No, those are obviously arrays of integers inferred from the non-NULL
element.

> Thanks for helping,
> atu
>

HTH.

--
Robert...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2010-03-29 11:27:40 Re: hstore equality-index performance question
Previous Message Armand Turpel 2010-03-29 10:32:25 one null value in array isnt allowed???