Search Postgresql Archives

Re: Determining if a table really changed in a trigger

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

 



On Tue, Oct 26, 2021 at 12:05 AM Mitar <mmitar@xxxxxxxxx> wrote:

But this fails if the table contains a JSON field with the error:

could not identify an equality operator for type json

Thus it is not possible to use whole row comparisons.  You will need to write the code to manually check equality on each column.  To check the json column you will probably want to cast to jsonb (if it isn't already) and then cast that to text and use a text equality check.  Since you are doing a statement trigger that means writing "SELECT col1, col2, etc...".


The table has an unique index column, if that helps.


That would be assumed since you need to be able to identify records whose contents might otherwise be identical.

David J.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux