Can I trigger an action from a coalesce ?

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Can I trigger an action from a coalesce ?
Date: 2020-02-22 21:02:06
Message-ID: 20200222210206.GA17445@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-02-22 21:05:32 Re: Can I trigger an action from a coalesce ?
Previous Message Edson Richter 2020-02-22 19:23:05 RE: Replication: slave server has 3x size of production server?