renaming columns... danger?

From: Michael Teter <michael_teter(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: renaming columns... danger?
Date: 2000-10-27 05:01:41
Message-ID: 20001027050141.76502.qmail@web10004.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

hi.

I just discovered that doing an alter table ... alter
column (to rename a column) does not do a complete
rename throughout the database.

for example, say you have table a, with columns b and
c. b is your primary key.

now rename b to new_b. if you do a dump of the schema
after you rename, you'll find that you can't reload
that schema because at the bottom of the definition of
table a you have PRIMARY KEY ("b").

shouldn't rename update any index and key definitions?

also, and this may actually the source of the problem,
while scanning my full (schema and data) dump, I
noticed that the contents of table pga_layout also had
the old values of columns that I have renamed.

I'm very frightened right now, because I'm rather
dependent upon my database right now. I don't like
the thought that my database is corrupt at the schema
level.

michael

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf! It's FREE.
http://im.yahoo.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2000-10-27 05:06:42 Re: pgsql/src/backend/nodes (copyfuncs.c outfuncs.c print.c)
Previous Message Bruce Momjian 2000-10-27 04:55:17 Re: 7.0 vs. 7.1 (was: latest version?)

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-10-27 05:33:41 Re: HELP! ... pg_locale ???
Previous Message Peter Eisentraut 2000-10-26 19:12:59 Re: Alternate Database Locations