concatenation operator || with "null" array

From: "stroncococcus" <stroncococcus(at)gmx(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: concatenation operator || with "null" array
Date: 2006-12-06 22:43:08
Message-ID: 1165444988.517457.228040@l12g2000cwl.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar 2006-12-06 22:59:13 Re: Anything I can do to speed up this query?
Previous Message Michael Glaesemann 2006-12-06 22:35:57 Re: Array shift equivalent?