Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?
Дата
Msg-id 20090522093431.GB5407@samason.me.uk
обсуждение исходный текст
Ответ на Re: Fast ALTER TABLE ... ADD COLUMN ... DEFAULT xxx?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gevik Babakhani
Дата:
Сообщение: A humble request
Следующее
От: David Fetter
Дата:
Сообщение: Re: A humble request