Re: ALTER COLUMN/logical column position

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER COLUMN/logical column position
Дата
Msg-id 4437.1069343366@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ALTER COLUMN/logical column position  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> Exactly.  I'm considerably more worried about breaking out-of-the-way
>> places in the backend than I am about what order someone's admin tool
>> presents the columns in.

> Clearly, the effort of adding logical column numbers will consist of
> making choices between physical and logical numbers in the backend in some
> places.  So one option is to replace some uses of attnum by attlognum.
> The other optionis to replace *all* uses of attnum by attphysnum and then
> replace some uses of attphysnum by attnum.  To me, this looks like an
> equal "risk" as far as the backend goes.

This would be a reasonable assessment if we had our hands on every line
of backend code that exists.  But you are neglecting the probability of
breaking user-written C functions, PL languages outside the main distro,
etc.

If we were going to go about this in a way that does not localize the
changes, I'd be inclined to use "attlognum" and "attphysnum" ... that
is, *deliberately* break every use that hasn't been looked at and
updated.  Even that would not guarantee catching all the trouble spots;
for example loop indexes and attnums passed as function parameters might
not have names that would be caught by a simplistic search-and-replace
update.

I'm for localizing the changes.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: ALTER COLUMN/logical column position
Следующее
От: Alvaro Herrera Munoz
Дата:
Сообщение: Re: logical column position