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