Detecting column changes in a postgres update trigger

后端 未结 3 362
清歌不尽
清歌不尽 2021-01-12 05:34

I have a postgres database with several tables that I want to watch for updates on, and if there\'s any updates, I want to fire a \"hey, something changed\" update. This wor

3条回答
  •  不知归路
    2021-01-12 05:47

    Another way is to exploit JSON/JSONB functions that come in recent versions of PostgreSQL. It has the advantage of working both with anything that can be converted to a JSON object (rows or any other structured data), and you don't even need to know the record type.

    See my original StackOverflow post with appropriate examples.

提交回复
热议问题