Re: restore single table

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: restore single table
Дата
Msg-id 02FF709A-DC7B-48F5-9869-085FEFEEB7CA@solfertje.student.utwente.nl
обсуждение исходный текст
Ответ на Re: restore single table  ("Albe Laurenz" <laurenz.albe@wien.gv.at>)
Список 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!



В списке pgsql-general по дате отправления:

Предыдущее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: funny view/temp table problem with query
Следующее
От: Michael Akinde
Дата:
Сообщение: Re: Large object loading stalls