adding a nullable col could rewrite the whole table?

From: Scara Maccai <m_lists(at)yahoo(dot)it>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: adding a nullable col could rewrite the whole table?
Date: 2009-08-14 12:37:14
Message-ID: 850000.2913.qm@web24603.mail.ird.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

in the docs I read:

"Adding a column with a non-null default [...] will require the entire table to be rewritten"

I guess that that can't be read as "you can always assume that adding a nullable column to a table won't rewrite the whole table".

I'm asking because since the page layout includes a null bitmap that
"If it is present it begins just after the fixed header and occupies enough bytes to have one bit per data column", I guess that when all the bits in the bitmap are used when I add a column (even a nullable one) the table gets rewritten (to add a new byte to the nullable bitmap); is this true?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scara Maccai 2009-08-14 12:40:37 R: Table as parameter
Previous Message Alex Paulo 2009-08-14 12:25:18 Table as parameter