Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j5buf-0004WV-0l for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 21:02:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j5bud-000174-Or for pgsql-general@arkaria.postgresql.org; Sat, 22 Feb 2020 21:02:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j5bud-00013Z-Bf for pgsql-general@lists.postgresql.org; Sat, 22 Feb 2020 21:02:11 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j5bua-0006aA-Qs for pgsql-general@lists.postgresql.org; Sat, 22 Feb 2020 21:02:09 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 48Q13g1sCQzw7F for ; Sat, 22 Feb 2020 16:02:07 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 17622) id 48Q13g0KWHzfYm; Sat, 22 Feb 2020 16:02:06 -0500 (EST) Date: Sat, 22 Feb 2020 16:02:06 -0500 From: stan To: pgsql-general@lists.postgresql.org Subject: Can I trigger an action from a coalesce ? Message-ID: <20200222210206.GA17445@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I have a case where if a value does not exist, I am going to use a default, which is easy with coalesce. But I would like to warn the user that a default has been supplied. The default value is reasonable, and could actually come from the source table, so I can't just check the value. I'd like to do a raise NOTICE, if the default portion of the coalesce fires. Anyone have a good way to accomplish this? -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin