Re: ERROR: cannot change name of view column - Mailing list pgsql-bugs

From Tom Lane
Subject Re: ERROR: cannot change name of view column
Date
Msg-id 11494.1546374204@sss.pgh.pa.us
Whole thread Raw
In response to Re: ERROR: cannot change name of view column  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: ERROR: cannot change name of view column
List pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tuesday, January 1, 2019, Réal A. Carbonneau <contact@realcarbonneau.com>
> wrote:
>> Since CREATE ... OR REPLACE  is literally: "if exists, drop and create,
>> else, create",

> It’s specifically saying “replace the query used for the view without
> changing the view signature/type”.

Right, it's *not* a DROP.  If it were, we'd make dependent views go away,
and the concern for preserving the view's rowtype would be much less.

> Same goes for create or replace
> function.  The point being the signature is public and cannot be changed on
> the fly but the implementation can be replaced.

The analogy to functions is on-point here.  We used to allow CREATE OR
REPLACE FUNCTION to change the names of function parameters, but we had to
disallow that (or at least greatly restrict it, I don't remember details
right now) when we started allowing calls that use parameter names to
disambiguate arguments.

            regards, tom lane


pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: ERROR: cannot change name of view column
Next
From: Réal A. Carbonneau
Date:
Subject: Re: ERROR: cannot change name of view column