Re: UPDATE ... SET = DEFAULT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: UPDATE ... SET = DEFAULT
Date
Msg-id 16959.1054845947@sss.pgh.pa.us
Whole thread Raw
In response to UPDATE ... SET = DEFAULT  (Rod Taylor <rbt@rbt.ca>)
Responses Re: UPDATE ... SET = DEFAULT
List pgsql-hackers
Rod Taylor <rbt@rbt.ca> writes:
> It would seem a new primnode (change InsertDef into SetDefault or
> similar) will be required with some executor logic.

It is not the executor's business to know about defaults.  The rewriter
is the place where defaults get inserted - see rewriteTargetList().

Note that default NULL will have to be treated a little differently from
what we do for INSERT, since the, um, default behavior of UPDATE is to
preserve columns rather than replace 'em with nulls.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera Munoz
Date:
Subject: Re: default locale considered harmful? (was Re: [GENERAL]
Next
From: Josh Berkus
Date:
Subject: Re: Proposal to Re-Order Postgresql.Conf, part II