如何在 PostgreSQL 中列出表的所有约束(主键、外键、检查、唯一互斥、..)?
In PostgreSQL 9.6 and later, what is the correct way to define a trigger function that will perform an update whenever an insert would fail because of a uniqueness constraint?
I know it is straightforward to write insert ... on conflict ... do update set ... statements, but my
idea is that I want to have some tables that treat repeated inserts as updates; otherwise that piece
of logic would have to be taken care of by the application, not …