Some assorted comments: 1. - When a column is added with <literal>ADD COLUMN</literal>, all existing - rows in the table are initialized with the column's default value - (NULL if no <literal>DEFAULT</literal> clause is specified). - If there is no <literal>DEFAULT</literal> clause, this is merely a metadata - change and does not require any immediate update of the table's data; - the added NULL values are supplied on readout, instead. + When a column is added with <literal>ADD COLUMN</literal> and a + non-volatile <literal>DEFAULT</literal> is specified, the default is + evaluated at the time of the statement and the result stored in the + table's metadata. That value will be used for the column for all existing + rows. If no <literal>DEFAULT</literal> is specified, NULL is used. In + neither case is a rewrite of the table required.
/the result stored/the result is stored 2. +/* + * Structure used to represent value to be used when the attribute is not + * present at all in a tuple, i.e. when the column was created after the tuple + */ + +typedef struct attrMissing +{ + bool ammissingPresent; /* true if non-NULL missing value exists */ + Datum ammissing; /* value when attribute is missing */ +} AttrMissing; + a. Extra space (empty line) between structure and comments seems unnecessary. b. The names of structure members seem little difficult to understand if you and or others also think so, can we rename them to something like (missingPresent, missingVal) or (attmissingPresent, attmissingVal) or something similar. Patch to address 1 and 2a is attached. What do you think about 2b? -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
cosmetic_changes_fast_addcol_v1.patch
Description: Binary data