Finding the hash value of a row in postgresql

后端 未结 2 404
粉色の甜心
粉色の甜心 2020-12-30 21:37

Is there a way to get the hash code of a row in postgresql?

I need to export some data only if there is some changes in the data after the last export, the last ex

相关标签:
2条回答
  • 2020-12-30 22:10

    An alternative approach would be to set an ON INSERT OR UPDATE trigger which would insert the current timestamp into a last_modified column, and then simply querying based on this column when your import process runs.

    0 讨论(0)
  • 2020-12-30 22:14

    Cast the row to text and use md5 to make a hash:

    SELECT
        md5(CAST((f.*)AS text))
    FROM
        foo f;
    
    0 讨论(0)
提交回复
热议问题