Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D98FAB5DBFD for ; Tue, 4 Oct 2011 23:39:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 02268-04 for ; Wed, 5 Oct 2011 02:39:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id ED752B5DBFC for ; Tue, 4 Oct 2011 23:39:52 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p952dgu02102; Tue, 4 Oct 2011 22:39:42 -0400 (EDT) From: Bruce Momjian Message-Id: <201110050239.p952dgu02102@momjian.us> Subject: Re: coalesce In-Reply-To: <7070.1317780542@sss.pgh.pa.us> To: Tom Lane Date: Tue, 4 Oct 2011 22:39:42 -0400 (EDT) CC: Alvaro Herrera , Henry Drexler , Kevin Grittner , Pg Docs X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1317782382-1049-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/4 X-Sequence-Number: 7004 --ELM1317782382-1049-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Tom Lane wrote: > Bruce Momjian writes: > > Here is a doc patch that at least explains the example. Applied. > > I think s/or/otherwise/ (both places) would make that read better. Done with the attached patch. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --ELM1317782382-1049-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/coalesce2" diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml new file mode 100644 index 2f307c2..bedd8ba *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *************** SELECT ... WHERE CASE WHEN x <> 0 *** 10015,10022 **** SELECT COALESCE(description, short_description, '(none)') ... ! This returns description if it is not null, or ! short_description if it is not null, or (none). --- 10015,10022 ---- SELECT COALESCE(description, short_description, '(none)') ... ! This returns description if it is not null, otherwise ! short_description if it is not null, otherwise (none). --ELM1317782382-1049-0_--