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 7392F53B2B for ; Mon, 28 Mar 2005 09:43:07 +0100 (BST) 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 77609-05 for ; Mon, 28 Mar 2005 08:42:57 +0000 (GMT) Received: from mx11.cksoft.de (mx11.cksoft.de [62.111.66.11]) by svr1.postgresql.org (Postfix) with ESMTP id 96B3453B20 for ; Mon, 28 Mar 2005 09:42:56 +0100 (BST) Received: from vesihiisi.cksoft.de (unknown [192.168.64.10]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mx12.cksoft.de (Postfix) with ESMTP id 60714B98C; Mon, 28 Mar 2005 10:42:56 +0200 (CEST) Received: from vesihiisi.cksoft.de (localhost [127.0.0.1]) by vesihiisi.cksoft.de (Postfix) with ESMTP id A7F92209C; Mon, 28 Mar 2005 10:42:54 +0200 (CEST) Received: by vesihiisi.cksoft.de (Postfix, from userid 1000) id E59C920B8; Mon, 28 Mar 2005 10:42:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by vesihiisi.cksoft.de (Postfix) with ESMTP id E3F8C20B4; Mon, 28 Mar 2005 10:42:51 +0200 (CEST) Date: Mon, 28 Mar 2005 10:42:51 +0200 (CEST) From: Christian Kratzer X-X-Sender: ck@vesihiisi.cksoft.de To: Enrico Weigelt Cc: pgsql-sql Subject: Re: (non)zero function In-Reply-To: <20050327155807.GB16122@nibiru.borg.metux.de> Message-ID: <20050328104059.A93661@vesihiisi.cksoft.de> References: <20050327155807.GB16122@nibiru.borg.metux.de> X-Spammer-Kill-Ratio: 75% MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by AMaViS cksoft-s20020300-20031204bz on vesihiisi.cksoft.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/364 X-Sequence-Number: 20843 Hi, On Sun, 27 Mar 2005, Enrico Weigelt wrote: > > Hi folks, > > > is there an function returning true if the argument is null or > zero (just to make some queries more concise). Of course its > trivial to implement as SQL function, but if postgresql already > provides such a function, I would prefer using it. Lookup the documentation on COALESCE() http://www.postgresql.org/docs/current/static/functions-conditional.html 9.13.2. COALESCE Greetings Christian -- Christian Kratzer ck@cksoft.de CK Software GmbH http://www.cksoft.de/ Phone: +49 7452 889 135 Fax: +49 7452 889 136