Search Postgresql Archives

Re: Rename a column if not already renamed.?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 time the 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 the redefined 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@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux