one null value in array isnt allowed???

Started by Armand Turpelabout 16 years ago2 messagesgeneral
Jump to latest
#1Armand Turpel
aturpel@mnhn.lu

Hi,

Updating an array field with one null value isnt possible:

UPDATE table SET integer_array = ARRAY[NULL]

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?

Thanks for helping,
atu

#####################################################################################
Scanned by MailMarshal - Marshal's comprehensive email content security solution.
#####################################################################################

#2Wappler, Robert
rwappler@ophardt.com
In reply to: Armand Turpel (#1)
Re: one null value in array isnt allowed???

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...