pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Teter <michael_teter@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: renaming columns... danger?
Date: Thu, 26 Oct 2000 22:01:41 -0700 (PDT)
Message-ID: <20001027050141.76502.qmail@web10004.mail.yahoo.com> (raw)

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/



view thread (6+ messages)  latest in thread

Message-ID: <20001027050141.76502.qmail@web10004.mail.yahoo.com>
Permalink:  ../20001027050141.76502.qmail@web10004.mail.yahoo.com/
Also on:    postgresql.org/message-id/20001027050141.76502.qmail@web10004.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: michael_teter@yahoo.com
  Subject: Re: renaming columns... danger?
  In-Reply-To: <20001027050141.76502.qmail@web10004.mail.yahoo.com>
  References: <20001027050141.76502.qmail@web10004.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox