From: sivapostgres@yahoo.com <sivapostgres@yahoo.com>
To: Postgresql General Group <pgsql-general@lists.postgresql.org>
Subject: Re: How to set a value when NULL
Date: Wed, 11 Mar 2020 11:49:09 +0000 (UTC)
Message-ID: <423512419.3693197.1583927349564@mail.yahoo.com> (raw)
References: <423512419.3693197.1583927349564.ref@mail.yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: sivapostgres@yahoo.com
Subject: Re: How to set a value when NULL
In-Reply-To: <423512419.3693197.1583927349564@mail.yahoo.com>
References: <423512419.3693197.1583927349564.ref@mail.yahoo.com> <423512419.3693197.1583927349564@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox