Re: Rename a column if not already renamed.?

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Rename a column if not already renamed.?
Дата
Msg-id fec4a6ac-750e-6702-e864-d44ce3517d91@aklaver.com
обсуждение исходный текст
Ответ на RE: Rename a column if not already renamed.?  ("Day, David" <david.day@redcom.com>)
Список pgsql-general
On 8/21/19 11:58 AM, Day, David wrote:
> Restoring into 11.3 instance the 9.6 dump  ? ->  yes.
> 
> For the upgrade scenario, I  confirmed that both old column name and new name are in the pg_attribute table at the
timethe patch attempts to rename it.
 
> Why both  is a big question.

I been playing around with that and the only way I can see it happening 
is that both columns actually exist in the table.

This leads to:

1) Examine the output of the pg_dump file to see if the table comes over 
with both columns.

2) Examine the table in the 11.3 instance to see if has both columns. An 
indication to me that patch process is adding back the old column.

3) If neither 1) or 2) examine the patch process to see if it has both 
columns in the table at some point in time and then removes the old column.

> However,
> It is easy enough to re-write the column rename function to deal with the simultaneous possibility.  I will include
theredefined function in the merge patch and see how it goes.
 
> 
> I'll update the thread after some further exploration.
> 
> Thanks all for your assistance.
> 
> 



-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Importing from CSV, auto creating table?
Следующее
От: "Arnaud L."
Дата:
Сообщение: psql \copy hanging