Re: Add columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add columns
Дата
Msg-id 18364.1136312141@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Add columns  (P G <pgress5@yahoo.com>)
Список pgsql-general
P G <pgress5@yahoo.com> writes:
> I see that one can add a new column to an existing
> table.  The documentation was not clear on how
> efficient this operation would be.
> Does PostgreSQL make a copy of the entire table when
> adding a new column?  Or does it simply use extra
> space in the data blocks to add the new column?

If the new column has no default expression (ie, default null) then
adding a column doesn't touch the table at all, only some catalog
entries.

Inserting data into the column is expensive, of course, since you
have to update every row in the table to put it there.  This is
not different from any other UPDATE operation.

            regards, tom lane

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: generic way to retrieve array as rowset
Следующее
От: "Chander Ganesan"
Дата:
Сообщение: Re: Need Licensing Information for bundling POSTGRESQL With Softwares