concatenation operator || with "null" array - Mailing list pgsql-general

From stroncococcus
Subject concatenation operator || with "null" array
Date
Msg-id 1165444988.517457.228040@l12g2000cwl.googlegroups.com
Whole thread Raw
Responses Re: concatenation operator || with "null" array  ("stroncococcus" <stroncococcus@gmx.de>)
Re: concatenation operator || with "null" array  ("Brandon Aiken" <BAiken@winemantech.com>)
Re: concatenation operator || with "null" array  (Bruce Momjian <bruce@momjian.us>)
List pgsql-general
Hello!

When I try to fill an array with the concatenation operator, like
UPDATE test SET myint = myint || ARRAY[123] WHERE id = 1
that before that statement was null, then it is also null after that
statement.
But if there is already something in that array and I execute that
statement, then everything works fine and one can find the 123 there,
too.
Is this the normal behavior? Is there a way to "concatenate" to null
arrays as well, or do I have to test this inside my script, and if it
is null fill it normal for the first time?

Best regards,
Kai


pgsql-general by date:

Previous
From: "BigSmoke"
Date:
Subject: The relative stability of different procedural languages
Next
From: "stroncococcus"
Date:
Subject: Re: concatenation operator || with "null" array