Re: ERROR: cannot change name of view column
От | Réal A. Carbonneau |
---|---|
Тема | Re: ERROR: cannot change name of view column |
Дата | |
Msg-id | CAJ-S0v5aWWFUZg6QzLRP27M6R0mRYr187+78AFcBhwNFno1LmQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: ERROR: cannot change name of view column (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | 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@sss.pgh.pa.us wrote:
"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 по дате отправления: