From: | wsheldah(at)lexmark(dot)com |
---|---|
To: | "Christian H(dot) Stork" <cstork(at)ics(dot)uci(dot)edu> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Evolving databases (eg deleting columns) |
Date: | 2002-07-26 13:27:40 |
Message-ID: | 200207261327.JAA10562@interlock2.lexmark.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
If you can afford time-wise to do a full dump and restore, editing the dump file
seems safest. That way foreign keys and other dependencies are maintained when
you delete a column, since all those dependencies get re-created. I'm certainly
no expert, but that's the best solution I've found so far. I believe better
support for ALTER is planned for a future release.
Wes Sheldahl
"Christian H. Stork" <cstork%ics(dot)uci(dot)edu(at)interlock(dot)lexmark(dot)com> on 07/25/2002
08:19:18 PM
To: pgsql-general%postgresql(dot)org(at)interlock(dot)lexmark(dot)com
cc: (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject: [GENERAL] Evolving databases (eg deleting columns)
Hi everyone,
I'm new to databases and PostgreSQL in particular. Currently, I'm
playing around with some test DBs, which already contain some valuable
data.
My question: How can I evolve databases (ie deleting columns,
adding/changing/removing constraints, etc)?
I tried using pg_dump and editing the dump file. While reading the dump
file helped me to understand how I could do it, the editing of the data
was quite cumbersome.
I also know about ALTER, but there seems to be no way to delete columns.
Which means that I'd have to create a new table, populate it, but what
do I do with other tables that used the original table as FOREIGN KEYS?
These kinds of problems make me suspect that there are other ways of
evolving tables.
I was just wondering how other users of PostgreSQL solve this problem.
What are good recipes to evolve databases?
Any hints welcome! Thanks,
--
Chris Stork (PhD student at UC Irvine) http://www.ics.uci.edu/~cstork/
OpenPGP fingerprint: B08B 602C C806 C492 D069 021E 41F3 8C8D 50F9 CA2F
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
From | Date | Subject | |
---|---|---|---|
Next Message | Elielson Fontanezi | 2002-07-26 13:27:58 | set DateStyle to 'SQL' |
Previous Message | Philipp Leibfried | 2002-07-26 13:15:55 | Transaction context switching? |