Tom Lane wrote: > Christopher Kings-Lynne <[EMAIL PROTECTED]> writes: > > The real problem here is the fact that there are now missing attnos in > > pg_attribute. Either that's handled or we renumber the attnos - which is > > also quite hard? > > Updating pg_attribute per se is not so hard --- just store new copies of > all the rows for the table. However, propagating the changes into other > places could be quite painful (I'm thinking of column numbers in stored > constraints, rules, etc). > > It seems to me that reducing the column to NULLs already gets you the > majority of the space savings. I don't think there is a case to be made > that getting back that last bit is worth the pain involved, either in > implementation effort or direct runtime costs (do you really want a DROP > COLUMN to force an immediate rewrite of the whole table?)
That is an excellent point about having to fix all the places that refer to attno. In fact, we have been moving away from attname references to attno references for a while, so it only gets worse. Tom is also correct that setting it to NULL removes the problem of disk space usage quite easily. That only leaves the problem of having gaps in the pg_attribute for that relation, and as I remember, that was the problem for Hiroshi's DROP COLUMN change, but at this point, after years of delay with no great solution on the horizon, we may as well just get this working. -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly