append columns that are null

From: Gerwin Philippo <gerwin(at)vernet(dot)nl>
To: pgsql-sql(at)postgresql(dot)org
Subject: append columns that are null
Date: 2004-07-07 15:01:22
Message-ID: 40ec1043$0$559$e4fe514c@news.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I have function that appends 2 columns, like
"new.field1 = new.field2||new.field3",
but when field 3 is null, then the entire outcome is null, while I
expected just field2, since when I append nothing to field2, I get
field2, right?
Is this standard behaviour, and if so, is there another append function
that I can use that doesn't behave like this?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message nobody 2004-07-07 15:25:32 Re: append columns that are null
Previous Message Mischa Sandberg 2004-07-07 12:43:43 Re: Triggers - need help !!!