Search Postgresql Archives

Difference between "add column" and "add column" with default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.

What is the technical difference between adding a column to a table and then apply a "set value = ..." to all columns and adding a column with a default value = ...?

I have seen that the first duplicates all rows, I had to vacuum and reindex the whole table. Okay so far, I have expected this. But this wasn't necessary with the second option, nevertheless, fetching some rows showed, that the value of the new column was my default value.

So, I'm curious: what happens (not) here?

Thx for the explanation.

cug

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux