Re: ALTER TABLE TODO items - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: ALTER TABLE TODO items
Date
Msg-id 200405051751.i45HpNu11161@candle.pha.pa.us
Whole thread Raw
In response to ALTER TABLE TODO items  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> select * from another;
>  f1 |  f2   
> ----+-------
>   1 | one
>   2 | two
>   3 | three
> (3 rows)
> 
> alter table another
>   alter f1 type text using f2 || ' more',
>   alter f2 type bigint using f1 * 10;
> 
> select * from another;
>      f1     | f2 
> ------------+----
>  one more   | 10
>  two more   | 20
>  three more | 30
> (3 rows)

Wow, you can reference different column as part of the alter column.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE TODO items
Next
From: Bruce Momjian
Date:
Subject: initdb failure in CVS