On Mon, Sep 29, 2014 at 7:21 AM, Simon Riggs <si...@2ndquadrant.com> wrote: > Having said that, it would be much nicer to have a mode that allows > you to just say the word "UPDATE" and have it copy the data into the > correct columns, like MySQL does. That is very intuitive, even if it > isn't very flexible.
I thought about this, and at first I agreed, but now I'm not so sure. Consider the case where you write an INSERT ... ON CONFLICT UPDATE ALL query, or however we might spell this idea. 1. Developer writes the query, and it works fine. 2. Some time later, the DBA adds an inserted_at column (those are common). The DBA is not aware of the existence of this particular query. The new column has a default value of now(), say. Should we UPDATE the inserted_at column to be NULL? Or (more plausibly) the default value filled in by the INSERT? Or leave it be? I think there is a case to be made for all of these behaviors, and that tension makes me prefer to not do this at all. It's like encouraging "SELECT *" queries in production, only worse. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers