Re: Best practice for altering a table
От
Josh Berkus
Тема
Re: Best practice for altering a table
Дата
Msg-id
web-1821207@davinci.ethosmedia.com
Ответ на
Re: Best practice for altering a table (Tom Lane)
Список
Дерево обсуждения
Best practice for altering a table Tim Wilson <wilson@visi.com>
Re: Best practice for altering a table Tom Lane <tgl@sss.pgh.pa.us>
Re: Best practice for altering a table "Josh Berkus" <josh@agliodbs.com>
Tim, > > Not surprisingly, I've discovered that some of my VARCHARs are not > > long enough and I need to change them. > > > What is "best practice" for this sort of thing? > > Do you want something that will still work on Alpha Centauri in the > 24th-and-a-half century, or do you just want to get the job done > quickly? > > In the former case, creating a new table with the right schema > and INSERT/SELECT'ing into it is pretty bulletproof. (But it > won't help if you'd like to preserve view and foreign-key references > to the original table.) Personally, I'm fond of dumping the who database to text files, editing the text files, and re-loading. This is partly because of the large number of foriegn key constraints, triggers, and views in my databases. -Josh
В списке pgsql-novice по дате отправления