> On Feb 22, 2020, at 13:33, stan <st...@panix.com> wrote: > I suppose you are suggesting that the function try the original SELECT, and > if it returns a NULL then retun the default AND do the raise NOTICE? Something like this: create function supply_default() returns int as $$ begin raise notice 'Supplied default'; return 1; end; $$ immutable language plpgsql; xof=# create table t ( i integer default supply_default(), t text ); CREATE TABLE xof=# insert into t(i, t) values (2, 'text'); INSERT 0 1 xof=# insert into t(t) values ('text'); NOTICE: Supplied default INSERT 0 1 -- -- Christophe Pettus x...@thebuild.com
- Can I trigger an action from a coalesce ? stan
- Re: Can I trigger an action from a coalesce ? Adrian Klaver
- Re: Can I trigger an action from a coalesc... Christophe Pettus
- Re: Can I trigger an action from a coa... stan
- Re: Can I trigger an action from a... Christophe Pettus
- Re: Can I trigger an action f... Tom Lane
- Re: Can I trigger an acti... Christophe Pettus
- Re: Can I trigger an ... Tom Lane
- Re: Can I trigger an ... Christophe Pettus
- Re: Can I trigger an action from a coalesce ? Peter J. Holzer
- Re: Can I trigger an action from a coalesc... sivapostg...@yahoo.com
- Re: Can I trigger an action from a coa... Peter J. Holzer