From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Day, David <david.day@redcom.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Rename a column if not already renamed.?
Date: Wed, 21 Aug 2019 20:43:31 -0700
Message-ID: <fec4a6ac-750e-6702-e864-d44ce3517d91@aklaver.com> (raw)
In-Reply-To: <0d2329c38d244c72907c70297416287d@redcom.com>
References: <ef59a820008b4d3299428db52ecc32e0@redcom.com>
<CAKoxK+5X5pwc97Jwt+jPGi6Nnp2JUnQccAUJstfu_3dKY3b-wA@mail.gmail.com>
<c493cce5a73f468d91633f3d2daae284@redcom.com>
<17271.1566334606@sss.pgh.pa.us>
<a120205764b145f59093c58ba05b804b@redcom.com>
<db5acfde-b850-b4e7-5e08-7a5e150312c0@aklaver.com>
<0d2329c38d244c72907c70297416287d@redcom.com>
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@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, david.day@redcom.com, tgl@sss.pgh.pa.us, fluca1978@gmail.com
Subject: Re: Rename a column if not already renamed.?
In-Reply-To: <fec4a6ac-750e-6702-e864-d44ce3517d91@aklaver.com>
References: <ef59a820008b4d3299428db52ecc32e0@redcom.com> <CAKoxK+5X5pwc97Jwt+jPGi6Nnp2JUnQccAUJstfu_3dKY3b-wA@mail.gmail.com> <c493cce5a73f468d91633f3d2daae284@redcom.com> <17271.1566334606@sss.pgh.pa.us> <a120205764b145f59093c58ba05b804b@redcom.com> <db5acfde-b850-b4e7-5e08-7a5e150312c0@aklaver.com> <0d2329c38d244c72907c70297416287d@redcom.com> <fec4a6ac-750e-6702-e864-d44ce3517d91@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox