Re: Adding columns in the middle of tables - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: Adding columns in the middle of tables
Date
Msg-id 20040906075248.10519.qmail@web50006.mail.yahoo.com
Whole thread Raw
In response to Re: Adding columns in the middle of tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
 --- Tom Lane <tgl@sss.pgh.pa.us> escribió: 
> We looked at this and decided that it would be
> vastly more trouble than
> it's worth --- not only in terms of effort to
> implement the feature
> originally, but in ongoing maintenance and risk of
> bug creation.
> 
> For instance, the original proposals about it
> required separating
> "logical" and "physical" column numbers, so that a
> new column could be
> added physically at the end but logically be earlier
> in the sequence.
> This would be a huge amount of work to get done in
> the first place:
> you'd have to look at essentially every single use
> of column numbers
> in both the backend and every application and decide
> which flavor you
> wanted to use at that place.  And mistakenly using
> the wrong flavor
> would be a permanent gotcha that could be expected
> to introduce new bugs
> in future.
> 
> Given the 8.0 ALTER TABLE feature of being able to
> rewrite the whole
> table, one could now think about doing it without
> decoupling logical
> and physical numbers: just rewrite the table with
> the new column
> inserted in the proper place.  This moves the
> problem to a different
> area, which is being sure you have updated every
> place in the system
> catalogs and backend caches that references the old
> column numbers of
> the renumbered columns.  Again, doable in theory but
> a lot of work,
> and it introduces a bug hazard every time someone
> changes these data
> structures.
> 
> So, no we're not likely to do it ourselves, and we'd
> probably reject as
> unmaintainable any patch to do it in either of the
> above ways.  What's
> needed to get the idea off the "forget it" list is a
> different
> implementation plan that isn't going to create a
> maintenance headache.
> 
>             regards, tom lane

Got it. 

Obviously this is not a necesary feature and is a
feature that good design can do a very rare need.
I will think if there is another implementation plan
that can be used (but if *the core* didn't find it i
hardly will).

thanx a lot for the explanation,

Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com


pgsql-hackers by date:

Previous
From: Reini Urban
Date:
Subject: Re: APR 1.0 released
Next
From: Tatsuo Ishii
Date:
Subject: Re: huge execution time difference with almost same plan