Hi List,

I am doing a INSERT...ON CONFLICT...UPDATE.. on a table. The query is
mostly-UPDATE and does not change any columns most of the time, like
so:

  CREATE INDEX ON book(title);
  INSERT INTO book (isbn, title, author, lastupdate) VALUES ($1,$2,$3, now())
    ON CONFLICT (isbn) DO UPDATE set title=excluded.title,
author=excluded.author, lastupdate=excluded.lastupdate;

PostgreSQL seems to consider the title as changed and refused to do a
HOT-update. It works if I remove the `title=...` part.

Are there any tricks to make it smarter? The title don't change most
of the time after all.

Regards,
Daniel


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to