Re: [PATCH] rename column if exists

2022-01-16 Thread Julien Rouhaud
Hi, This patch has been around for about 10 months. There seems to be some support for the feature but 3 committers raised concerns about the patch, and the OP never answered, or clarified the intended use case until now. At that point I don't see this patch getting committed at all so I'm marki

Re: [PATCH] rename column if exists

2021-11-05 Thread David G. Johnston
On Fri, Nov 5, 2021 at 8:37 AM Robert Haas wrote: > > Making renaming work in the same kind of context is harder. You're > definitely going to have to upgrade the application and the schema in > lock step, unless the application is smart enough to work with the > column having either name. You'r

Re: [PATCH] rename column if exists

2021-11-05 Thread David G. Johnston
On Fri, Nov 5, 2021 at 8:08 AM Tom Lane wrote: > "David G. Johnston" writes: > > On Friday, November 5, 2021, Tom Lane wrote: > >> I'd be more willing to overlook that if a clear use-case had been > >> given, but AFAICS no concrete case has been offered. > > > The use case is the exact same one

Re: [PATCH] rename column if exists

2021-11-05 Thread Robert Haas
On Fri, Nov 5, 2021 at 10:40 AM Tom Lane wrote: > In this framework, RENAME IF EXISTS is in sort of a weird place. > You'd know that afterwards there is no longer any column with the > source name. But you are not entitled to draw any conclusions > about whether a column exists with the target na

Re: [PATCH] rename column if exists

2021-11-05 Thread Tom Lane
"David G. Johnston" writes: > On Friday, November 5, 2021, Tom Lane wrote: >> I'd be more willing to overlook that if a clear use-case had been >> given, but AFAICS no concrete case has been offered. > The use case is the exact same one for all of these - indempotence, ... except that, as I exp

Re: [PATCH] rename column if exists

2021-11-05 Thread David G. Johnston
On Friday, November 5, 2021, Tom Lane wrote: > > I'd be more willing to overlook that if a clear use-case had been > given, but AFAICS no concrete case has been offered. > > The use case is the exact same one for all of these - indempotence, especially in the face of being able to run migration sc

Re: [PATCH] rename column if exists

2021-11-05 Thread Tom Lane
"David G. Johnston" writes: > On Friday, November 5, 2021, Daniel Gustafsson wrote: >> I know that, I'm just not convinced that it's a feature (in the case at >> hand) > I don’t see how this one should be expected to meet a higher bar than drop > table or other existing commands. I get why in t

Re: [PATCH] rename column if exists

2021-11-05 Thread David G. Johnston
On Friday, November 5, 2021, Daniel Gustafsson wrote: > > I know that, I'm just not convinced that it's a feature (in the case at > hand) > I don’t see how this one should be expected to meet a higher bar than drop table or other existing commands. I get why in the nearby discussion create role

Re: [PATCH] rename column if exists

2021-11-05 Thread Daniel Gustafsson
> On 5 Nov 2021, at 13:03, Isaac Morland wrote: > > On Fri, 5 Nov 2021 at 05:21, Daniel Gustafsson > wrote: > > > Same reasoning as for all the other if exists we have, idempotence. Being > > able to run the command on an object that is already in the desired state >

Re: [PATCH] rename column if exists

2021-11-05 Thread Isaac Morland
On Fri, 5 Nov 2021 at 05:21, Daniel Gustafsson wrote: > > Same reasoning as for all the other if exists we have, idempotence. > Being able to run the command on an object that is already in the desired > state without provoking an error. > > If the object is known to be in the desired state, the

Re: [PATCH] rename column if exists

2021-11-05 Thread Daniel Gustafsson
> On 4 Nov 2021, at 14:26, David G. Johnston wrote: > > On Thursday, November 4, 2021, Daniel Gustafsson > wrote: > > On 22 Mar 2021, at 20:40, David Oksman > > wrote: > > > > Added the ability to specify IF EXISTS when renaming a column of

Re: [PATCH] rename column if exists

2021-11-04 Thread David G. Johnston
On Thursday, November 4, 2021, Daniel Gustafsson wrote: > > On 22 Mar 2021, at 20:40, David Oksman wrote: > > > > Added the ability to specify IF EXISTS when renaming a column of an > object (table, view, etc.). > > For example: ALTER TABLE distributors RENAME COLUMN IF EXISTS address TO > city;

Re: [PATCH] rename column if exists

2021-11-04 Thread Daniel Gustafsson
> On 22 Mar 2021, at 20:40, David Oksman wrote: > > Added the ability to specify IF EXISTS when renaming a column of an object > (table, view, etc.). > For example: ALTER TABLE distributors RENAME COLUMN IF EXISTS address TO city; > If the column does not exist, a notice is issued instead of thr

Re: [PATCH] rename column if exists

2021-06-16 Thread Yagiz Nizipli
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed Thank you for your contribution. This is a useful feature. Alth

[PATCH] rename column if exists

2021-03-23 Thread David Oksman
32bd8ced5dcb923575e1311e7353399b04c245fa Mon Sep 17 00:00:00 2001 From: David Oksman Date: Mon, 22 Mar 2021 21:22:00 +0200 Subject: [PATCH] rename column if exists --- doc/src/sgml/ref/alter_foreign_table.sgml | 2 +- doc/src/sgml/ref/alter_materialized_view.sgml | 2 +- doc/src/sgml/ref/alter_table.sgml | 4