One loose end in this patch is how to check for volatile default expressions.
copyfrom.c is a utility statement, so it can look at the parser's column list: COPY table(c1,c2)... However, for INSERT, in nodeModifyTable.c, it looks like parsing, rewriting, and planning are done, at which point I don't know if there's a good way to find that. The default expressions will have been rewritten into the planned statement. We need the list of columns whose default is volatile, excluding columns for which a non-default value is specified. INSERT INTO table (c1,c2) VALUES (1,default); We'd want the list of any column in the table with a volatile default, excluding columns c1, but not-excluding explicit default columns c2 or any implicit default columns (c3, etc). Any idea ? -- Justin