Re: Is it possible to have multiple names for a column? - Mailing list pgsql-general

From Bernhard Weisshuhn
Subject Re: Is it possible to have multiple names for a column?
Date
Msg-id 20060914204251.GA12470@weisshuhn.de
Whole thread Raw
In response to Is it possible to have multiple names for a column?  (felix@crowfix.com)
List pgsql-general
On Thu, Sep 14, 2006 at 12:18:05PM -0700, felix@crowfix.com 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;

If the clients only read the column, you could just add the new
column and create triggers that copy the value from the other column on
any modification.
Later you drop the old column and the triggers.

Maybe an approch based on rules might work? Dunno, haven't used them yet.

regards,
  bkw

pgsql-general by date:

Previous
From: Poul Møller Hansen
Date:
Subject: Sun Java Studio Creator and PostgreSQL
Next
From: "Joshua D. Drake"
Date:
Subject: Re: PostgreSQL slammed by PHP creator