Here, a lot of energy seems spent on Coalesce - I think it is to avoid the case where a null value in the update record could overwrite a non-null value.
Say we have a table of businesses and some field, let's say Address 2 is 'Second Floor' or Suite 123 or something not mission-critical, but important. For some reason, the owners or some directory owner removes the Address 2 field from the directory we are scraping or set Address 2 to NULL. In this case, we know something that the UPSERT/UPDATE doesn't know and it's valuable.
Now, on the other hand, maybe there is a field, a dumb example, like AOL Address in our database, and the business finally drops their AOL account, or updates their email to a Gmail one...so the AOL Address field comes in as NULL. In this case, the update record knows something new.
Can anyone answer whether UPSERT will update DATA with NO DATA/NULL? Can it be controlled? Is there yet a ChatGPT Python package that will make such decisions for me? If not, what is taking so long? :)
So, I would call my first example above an undesirable update, and the second one a desirable update, but until the ChatGPT thing is created, Postgres probably doesn't know which is which.
I assume the Postgres team did the smartest thing possible, but just don't know, and haven't found an understandable explanation, of what that is.
Can anyone lead me to the light on this issue?