Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E4F39B5DBD9 for ; Tue, 4 Oct 2011 22:47:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 16305-03 for ; Wed, 5 Oct 2011 01:47:16 +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 100A9B5DBC7 for ; Tue, 4 Oct 2011 22:47:15 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p951lG908071; Tue, 4 Oct 2011 21:47:16 -0400 (EDT) From: Bruce Momjian Message-Id: <201110050147.p951lG908071@momjian.us> Subject: Re: coalesce In-Reply-To: <1316623022-sup-9692@alvh.no-ip.org> To: Alvaro Herrera Date: Tue, 4 Oct 2011 21:47:15 -0400 (EDT) CC: Henry Drexler , Kevin Grittner , Pg Docs X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1317779235-25250-0_" Content-Transfer-Encoding: 8bit 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/2 X-Sequence-Number: 7002 --ELM1317779235-25250-0_ Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="UNKNOWN-8BIT" Alvaro Herrera wrote: > > Excerpts from Henry Drexler's message of miƩ sep 21 12:50:18 -0300 2011: > > thanks, > > > > so I take it I am not getting those more complex examples (that are > > apparently beyond my use case), I will take a look at them again. > > Maybe the fix is just to add a simpler example, without altering the > wording (which seems pretty clear to me as well, but then I already know > what COALESCE does). Here is a doc patch that at least explains the example. Applied. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --ELM1317779235-25250-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/coalesce" diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml new file mode 100644 index 0b6a109..2f307c2 *** a/doc/src/sgml/func.sgml --- b/doc/src/sgml/func.sgml *************** SELECT ... WHERE CASE WHEN x <> 0 *** 10015,10020 **** --- 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). --ELM1317779235-25250-0_--