X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 36F16D1B18C for ; Thu, 8 Jul 2004 05:58:39 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09364-09 for ; Thu, 8 Jul 2004 08:58:35 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 3C7F2D1B258 for ; Thu, 8 Jul 2004 05:58:32 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i688wWi7053891 for ; Thu, 8 Jul 2004 08:58:32 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i688rOAx053069 for pgsql-sql@postgresql.org; Thu, 8 Jul 2004 08:53:24 GMT From: "nobody" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: append columns that are null Date: Thu, 8 Jul 2004 09:53:41 +0100 Organization: Hub.Org Networking Services Lines: 23 Message-ID: References: <40ec1043$0$559$e4fe514c@news.xs4all.nl> <40ecf718$0$36169$e4fe514c@news.xs4all.nl> X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.9 tagged_above=0.0 required=5.0 tests=NO_DNS_FOR_FROM, PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200407/50 X-Sequence-Number: 18302 You are welcome. Only if all problems were that simple ;-)... "Gerwin Philippo" wrote in message news:40ecf718$0$36169$e4fe514c@news.xs4all.nl... > THX! didn't know that one yet :) > > nobody wrote: > > "Gerwin Philippo" wrote in message > > news:40ec1043$0$559$e4fe514c@news.xs4all.nl... > > > >>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? > > > > > > COALESCE is your friend... > > > >