Re: How to enforce the use of the sequence for serial columns

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

 



> It's not a full solution anyway since it prevents any kind of update
on the table due to check constraints firing  even if target field not
updated.  >

Well, we can extend the check within the trigger:

if (coalesce old.a=new.a -- Update
    OR 
    new.a = currval(tg_argv[0] -- Insert
) then
  return new;		       
end if;

Marc




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux