Re: [HACKERS] ALTER TABLE ADD COLUMN
От
Chris Bitmead
Тема
Re: [HACKERS] ALTER TABLE ADD COLUMN
Дата
Msg-id
37547FC3.40106A5E@bigfoot.com
Список
Дерево обсуждения
Re: [HACKERS] Bug in LIKE ? Thomas Lockhart <lockhart@alumni.caltech.edu>
Bruce Momjian wrote: > Our TODO now has: > > * ALTER TABLE ADD COLUMN to inherited table put column in wrong place > > I don't think any of us understand the issues on this one. Let me guess at the problem. When you add a column, it doesn't change all the records, therefore the column must be added at the end. This means that the columns will not be in the same order as if you had created them from scratch. There seem to be three solutions: a) Go to a much more sophisticated schema system, with versions and version numbers (fairly hard but desirable to fix other schema change problems). Then insert the column in the position it is supposed to be in. b) Fix the copy command to input and output the columns, not in the order they are in, but in the order they would be in on re-creation. c) make the copy command take arguments specifying the field names, like INSERT can do. I think it would be good if Postgres had all 3 features. Probably (b) is the least work.
В списке pgsql-hackers по дате отправления