Re: ALTER TABLE ADD COLUMN fast default

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: ALTER TABLE ADD COLUMN fast default
Дата
Msg-id 20180220182023.5lwod5jr35b2mcd6@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: ALTER TABLE ADD COLUMN fast default  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ALTER TABLE ADD COLUMN fast default
Список pgsql-hackers
Hi,

On 2018-02-20 13:07:30 -0500, Tom Lane wrote:
> ... btw, I've not read this patch in any detail, but the recent thread
> about toast tables for system catalogs prompts me to wonder what happens
> if a "fast default" value is large enough to require out-of-line toasting.

Hm, interesting.


> I can easily think of problems that will ensue if we try to support that
> case, because right now the toast mechanisms assume that OOL toasted
> values can only be referenced from the associated table.

What problem are you seeing with treating the toasted value to be from
pg_attribute? I'm only drinking my first coffee just now, so I might be
missing something...

Now we certainly would need to make sure that the corresponding
pg_attribute row containing the default value doesn't go away too early,
but that shouldn't be much of a problem given that we never remove
them. I wondered for a second if there's problematic cases where the
default value is referenced by an index, and then the default-adding
transaction rolls back. But I can't construct anything realistically
problematic.

Greetings,

Andres Freund


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

Предыдущее
От: Marina Polyakova
Дата:
Сообщение: Re: master check fails on Windows Server 2008
Следующее
От: Tom Lane
Дата:
Сообщение: Re: master check fails on Windows Server 2008