From: | Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl> |
---|---|
To: | Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
Cc: | "Kevin Duffy *EXTERN*" <KD(at)wrinvestments(dot)com>, <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: restore single table |
Date: | 2009-02-25 11:29:14 |
Message-ID: | 02FF709A-DC7B-48F5-9869-085FEFEEB7CA@solfertje.student.utwente.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Feb 24, 2009, at 1:07 PM, Albe Laurenz wrote:
> Kevin Duffy wrote:
>> I need guidance on how move some changes that I have made to
>> my production database.
>>
> A few thoughts:
>
> Maybe you do not need to delete and recreate the table.
> An ALTER TABLE statement can, for example, add a column to
> an existing table.
> That way you could leave the foreign key constraints in place
> while you do the update.
>
> If you cannot avoid dropping and recreating the table, you
> could proceed like this: drop all foreign key constraints
> to your table, recreate it and add the constraints again.
>
> You should write an SQL script that does the necessary changes
> and test it beforehand.
>
> Lock out all database users while you perform substantial changes
> to the database.
You should also perform these operations in a transaction block so
that you can test (in that session) whether your changes behave as
expected before you commit (or rollback if they don't). Create
savepoints before performing such tests so that typos in your test
queries don't invalidate your schema changes.
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.
!DSPAM:737,49a52b8b129741404319634!
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Akinde | 2009-02-25 11:45:37 | Re: Large object loading stalls |
Previous Message | Grzegorz Jaśkiewicz | 2009-02-25 10:02:21 | funny view/temp table problem with query |