Re: [GENERAL] preventing ALTER TABLE RENAME from changing view definitions?

2007-02-26 Thread Tom Lane
"George Pavlov" <[EMAIL PROTECTED]> writes:
> Currently "ALTER TABLE ... RENAME TO ..." results in all views that
> refer to the table to be rewritten with the new table name.

They are not "rewritten".  Views refer to tables by OID, and are
therefore entirely insensitive to RENAME operations.  This is not
something we're likely to change.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [GENERAL] preventing ALTER TABLE RENAME from changing view definitions?

2007-02-26 Thread Richard Huxton

George Pavlov wrote:

Currently "ALTER TABLE ... RENAME TO ..." results in all views that
refer to the table to be rewritten with the new table name. This is a
good thing in the general case, but there are also situations where it
is not (e.g. temporarily renaming tables for data reorg reasons). I
can't seem to find a clean way to only rename the table without causing
change to the view. The ONLY keyword does not work in this case.
Anything I am missing (short of re-creating all views). I am on 8.1.


It'll either rename in all views, or not happen at all. Otherwise, 
there'd be nothing to stop you replacing the table with one that has an 
incompatible definition.


Is this something you do regularly, and if so what are you trying to 
achieve?


--
  Richard Huxton
  Archonet Ltd

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match