
* Henry Combrinck
You don't have a nice little alter...table(s) script you can paste herein, do you? ;-)
I think Robert Mathews' snippet should work, but I havent tested it myself. If I generalize his code a bit, to change column "bar" in table "foo" to int4, something like this would be required:
BEGIN; LOCK TABLE foo; ALTER TABLE foo ADD COLUMN new_col int; UPDATE foo SET new_col = bar; ALTER TABLE foo DROP COLUMN bar; ALTER TABLE foo RENAME COLUMN new_col TO bar; ALTER TABLE foo ADD PRIMARY KEY (bar); ALTER TABLE foo ALTER COLUMN bar SET DEFAULT nextval('"foo_bar_seq"'::text); COMMIT; ANALYZE;
The exact contents of nextval(...) should probably be copied from "\d foo" beforehand.
Keep your backups handy, and if you have the luxury to do so, try it on your test systems first...
Yup - that would work; too much work though. My 600MB dump has just finished. I'm going to dump the schema seperately and replace all bigint's with int, and restore. -------------------------------------------------------- This message was sent using MetroWEB's AirMail service. http://www.metroweb.co.za/ - full access for only R73. Free Web Accelerator, WebMail, Calendar, Anti-Virus, Anti-Spam, 10 emails, 100MB personal webspace, and more! Phone Now! 086 11 11 440