From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | CG <cgg007(at)yahoo(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: ALTER TABLE ... DISABLE TRIGGERS Isolation leve |
Date: | 2011-05-09 18:12:48 |
Message-ID: | 2296.1304964768@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
CG <cgg007(at)yahoo(dot)com> writes:
> I want to add a column to a table, but there are update triggers that will fire that don't need to fire for this operation. So, I'd like to add the column with triggers off. Normally this operation would take 10 or so seconds, so locking the table for that amount of time is not a big deal. I just want to make sure that no new data gets written to the table while the triggers are disabled.
Are you overthinking the problem? Adding a column without a default
doesn't do any row updates and shouldn't fire any triggers. I'm not
sure that adding a column *with* a default will fire update triggers
either. (That might be a bug, if so ...)
Suggest testing before assuming you have a problem to solve.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Sairam Krishnamurthy | 2011-05-09 19:33:35 | Table name as parameter |
Previous Message | Merlin Moncure | 2011-05-09 18:01:23 | Re: stunnel with just postgresql client part |