Re: Rename a column if not already renamed.?

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: "Day, David" <david(dot)day(at)redcom(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Rename a column if not already renamed.?
Date: 2019-08-20 19:40:49
Message-ID: CAKoxK+5X5pwc97Jwt+jPGi6Nnp2JUnQccAUJstfu_3dKY3b-wA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 20, 2019 at 9:07 PM Day, David <david(dot)day(at)redcom(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Day, David 2019-08-20 19:50:35 RE: Rename a column if not already renamed.?
Previous Message Adrian Klaver 2019-08-20 19:16:24 Re: Rename a column if not already renamed.?