Re: Altering Column Date Types

Поиск
Список
Период
Сортировка
От Chris Boget
Тема Re: Altering Column Date Types
Дата
Msg-id 022f01c2c625$0645ea10$8c01a8c0@ENTROPY
обсуждение исходный текст
Ответ на Re: Altering Column Date Types  (Aarni Ruuhimäki <aarni.ruuhimaki@kymi.com>)
Список pgsql-novice
> I use 'pg_dump -c my_db > my_db_dump' and then edit the dump file's CREATE
> TABLE statements to change column data-tytes. When done, read or re-create
> the db back in with 'cat my_db_dump | psql my_db'
> Just make sure your data fits into the new data-type.

The only thing that may be problematic with this method is if the table being dumped
has some foreign key constraints on it from other tables.  So to add on to the above
steps, before you dump (or some time before you recreate the table), drop the other
constraints, do the above then recreate the other constraints.
Pain in the butt, yes, but unless you do this you won't be able to drop the table in
the first place.

Chris


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

Предыдущее
От: Antonio Scotti
Дата:
Сообщение: Passing parameters to a Trigger
Следующее
От: Steve_Miller@sil.org
Дата:
Сообщение: Re: collation