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

From Robert Treat
Subject Re: ALTER TABLE TODO items
Date
Msg-id 1083776671.14683.478.camel@camel
Whole thread Raw
In response to ALTER TABLE TODO items  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: ALTER TABLE TODO items  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, 2004-05-05 at 10:36, Bruce Momjian wrote:
> 
> TODO items completed:
> 
>         o -ALTER TABLE ADD COLUMN does not honor DEFAULT and non-CHECK CONSTRAINT
>         o -ALTER TABLE ADD COLUMN column DEFAULT should fill existing
>           rows with DEFAULT value
>         o -Allow ALTER TABLE to modify column lengths and change to binary
>           compatible types
> 
> Seems we didn't have ALTER COLUMN TYPE on the TODO list.
> 
> Do we still want this TODO?
> 
>         o Allow columns to be reordered using ALTER ... POSITION i col1 [,col2];
>           have SELECT * and INSERT honor such ordering
> 
> I don't think so.  As I remember it was part of doing logical attribute
> numbers as a way to add ALTER COLUMN TYPE, but because we now use table
> recreate to implement this, it is unlikely we will ever add logical
> attribute numbers (adds too much complexity to the code).
> 

I think we should leave since it is still functionality that people will
want. Furthermore I am not sure we are done with ALTER COLUMN TYPE
completely. Granted I've not yet had time to take a thorough look at the
implementation so I could be off here, but as I understand it the
current code seems a little problematic on large tables; recreating the
entire table is likely to cause excessive i/o and disk space issues
compared to a potentially much nicer add column/update column/drop
column routine. 

Hmm... upon further thought, if the above implementation stands up, istm
that its machinations could also be used to implement the reordering
functionality... ie. rewrite the table and fix up any dependencies as
needed.  

way to back track on myself eh? 

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres Crashes
Next
From: Bruce Momjian
Date:
Subject: Re: COPY command - CSV files