On Thu, May 21, 2009 at 12:26:08PM -0400, Tom Lane wrote: > I'd envision it > as an extra column in pg_attribute, and it would work for any column(s). > There's nothing to be gained by restricting it.
Yes, when I said "first" I meant the only thing that needs to be stored is the first default value for the column. The code currently assumes that this first default value is NULL and is hence able to optimize the case where you adding a NULLable column. Adding this first default value to pg_attribute would allow you to break this assumption and allow the user to have non-NULL default values without complete table rewrites. I think the discussion covered this, but I don't think I was particularly clear in my first message and thought I should attempt to explain what I was saying. Other comments about only allowing STABLE expressions and non-toastable values make sense and were the sorts of things I thought I would miss. -- Sam http://samason.me.uk/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers