Search Postgresql Archives

Re: INSERT Trigger to check for existing records

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

 



If you can modify your insert statement, and live with an extra column in the data, no trigger is needed as best I can figure.

Create a unique index over the existing columns, add a "created_on" field and call insert on conflict (unique index) do nothing.

This should give the behavior you want.

[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