Re: ERROR: cannot change name of view column

From: Réal A(dot) Carbonneau <contact(at)realcarbonneau(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ERROR: cannot change name of view column
Date: 2019-01-01 21:52:54
Message-ID: CAJ-S0v5aWWFUZg6QzLRP27M6R0mRYr187+78AFcBhwNFno1LmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thank you all for your detailed responses and historical perspective on
this.

If this issue is closed here, then pgAdmin has some work next to generate
the appropriate ALTER statements when view column names change (of course
this is a completely separate issue)! ;)

Kind regards,
Réal

On Tue, Jan 1, 2019, 15:23 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us wrote:

> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > On Tuesday, January 1, 2019, Réal A. Carbonneau <
> contact(at)realcarbonneau(dot)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
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-01-02 07:56:19 BUG #15571: Installation failed
Previous Message Tom Lane 2019-01-01 20:23:24 Re: ERROR: cannot change name of view column