Search Postgresql Archives

Re: INSERT Trigger to check for existing records

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/21/20 8:20 AM, Adrian Klaver wrote:
On 11/21/20 8:00 AM, Hagen Finley wrote:
Hello,


Instead:

IF NEW.ndealid = OLD.ndealid AND NEW.revusd = OLD.revusd
         AND NEW.stage = OLD.stage THEN
     RETURN NULL; --Will cancel INSERT
ELSE
     RETURN NEW;

END IF;

Well this is what happens when I answer BC(before coffee). The above will not work, if for no other reason then OLD does not exist in an INSERT. Will try to come up with something that is in the realm of possibility.



Hagen

Larimer County, CO





--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux