Search Postgresql Archives

Re: Is it possible to have multiple names for a column?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2006-09-14 at 14:18, felix@xxxxxxxxxxx wrote:
> We have a need to rename some columns, but since we can't update both
> the database and the programs instantly, we'd like to temporarily
> assign both names to the same column while the updates are in
> progress.  Something like this would be super nifty :-)
> 
>     ALTER TABLE howdy_doody ADD NAME xyzzy TO COLUMN plugh;
> 
> I am pretty certain no such SQL command exists.  But is it possible to
> do something sneaky to the internal tables so that two names point to
> the same columnand everything just works?  Everything meaning updates,
> inserts, etc, not further ALTER TABLE and so on.

You could create a view, make the two outside names reference the one
inside name, and create a trigger to update based on which one if given
data and throw an error if you try to update both columns at the same
time.

Sounds like a lot of work though.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux