Re: How to set a value when NULL

From: "sivapostgres(at)yahoo(dot)com" <sivapostgres(at)yahoo(dot)com>
To: Postgresql General Group <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to set a value when NULL
Date: 2020-03-11 11:49:09
Message-ID: 423512419.3693197.1583927349564@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,Need to set a value of Zero when the field value is NULL in trigger function.
Tried with,NEW.fieldname = NULLIF(NEW.fieldname, 0)
in before insert/update trigger.
Looks like it's not working.  I'm doing anything wrong.
Happiness AlwaysBKR Sivaprakash

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Brannen 2020-03-11 13:14:51 RE: Patterns to look for in the PostgreSQL server log
Previous Message Nicola Contu 2020-03-11 09:54:52 Re: Streaming replication - 11.5