From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Day, David <david.day@redcom.com>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Rename a column if not already renamed.?
Date: Tue, 20 Aug 2019 13:07:31 -0700
Message-ID: <23685a61-6e3a-4b09-a2da-dc316e1917a0@aklaver.com> (raw)
In-Reply-To: <c493cce5a73f468d91633f3d2daae284@redcom.com>
References: <ef59a820008b4d3299428db52ecc32e0@redcom.com>
<CAKoxK+5X5pwc97Jwt+jPGi6Nnp2JUnQccAUJstfu_3dKY3b-wA@mail.gmail.com>
<c493cce5a73f468d91633f3d2daae284@redcom.com>
On 8/20/19 12:50 PM, Day, David wrote:
> Thanks for the feedback.
>
> The error is something like column already exists and
> Quoting issue is Unlikely, and as I mentioned it works as expected if Im repeating the patch in 11
The above and below us are the parts I am not understanding.
Can you provide us a step-by-step(workflow) for what you are doing?
> And I assume would if I was in 9.6.
>
> I suspect it has something to do with the content, or lack of, in the pg_attribute table following an upgrade.
>
> -----Original Message-----
> From: Luca Ferrari [mailto:fluca1978@gmail.com]
> Sent: Tuesday, August 20, 2019 3:41 PM
> To: Day, David <david.day@redcom.com>
> Cc: pgsql-general@postgresql.org
> Subject: Re: Rename a column if not already renamed.?
>
> On Tue, Aug 20, 2019 at 9:07 PM Day, David <david.day@redcom.com> wrote:
>> EXECUTE format ('ALTER TABLE %s RENAME %s TO %s', schema_table_,
>> old_name_, new_name);
>
> Hard to say without the error, but any chance there is a quoting problem?
> EXECUTE format ('ALTER TABLE %s RENAME %I TO %I', schema_table_, old_name_, new_name);
>
> Luca
>
--
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, fluca1978@gmail.com
Subject: Re: Rename a column if not already renamed.?
In-Reply-To: <23685a61-6e3a-4b09-a2da-dc316e1917a0@aklaver.com>
References: <ef59a820008b4d3299428db52ecc32e0@redcom.com> <CAKoxK+5X5pwc97Jwt+jPGi6Nnp2JUnQccAUJstfu_3dKY3b-wA@mail.gmail.com> <c493cce5a73f468d91633f3d2daae284@redcom.com> <23685a61-6e3a-4b09-a2da-dc316e1917a0@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