Lazy constraints / defaults

From: Michał Zaborowski <michal(dot)zaborowski(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Lazy constraints / defaults
Date: 2008-03-09 14:16:58
Message-ID: e2289d9e0803090716q3b78270ardc4cd7f1774639ad@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,
I would like to be able to add CONSTRAINT and/or DEFAULT with out
affecting old rows. Yes, it sounds strange, but... Let's say I have
big table, I want to add new column, with DEFAULT and NOT NULL.
Normally it means long exclusive lock. So - right now I'm adding plain
new column, then DEFAULT, then UPDATE on all rows in chunks, then NOT
NULL... Can it be little simpler?

--
Regards,
Michał Zaborowski (TeXXaS)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2008-03-09 14:48:44 Re: timestamp datatype cleanup
Previous Message Michael Meskes 2008-03-09 11:03:38 Re: timestamp datatype cleanup