Postgres (like almost all other DBMSs) will not check if the target values differ from the original ones. Therefore, the answer: yes, it will update the line, even if the values are different.
However, you can easily prevent an “empty” update in this case by including the where clause:
INSERT INTO topic (......) VALUES (......) ON CONFLICT (...) DO UPDATE set ...
The where clause will prevent a row that matches the one inserted from being updated. To make this work correctly, there is in your tab to display all columns of the target tables. Otherwise, the topic is distinct from excluded condition will always be true, since the excluded row has fewer columns and then the topic row and therefore it will be different from it.
Adding validation for changed values has been discussed several times on the mailing list and is always discarded. The main reason is that it makes no sense to have the overhead of checking for changes for each statement to deal with a few badly written ones.
source share