Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geQZW-0007oV-Qx for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jan 2019 20:23:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1geQZV-0004Xf-Fq for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Jan 2019 20:23:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geQZV-0004TN-6B for pgsql-bugs@lists.postgresql.org; Tue, 01 Jan 2019 20:23:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geQZS-0006KL-Nx for pgsql-bugs@postgresql.org; Tue, 01 Jan 2019 20:23:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x01KNOV3011495; Tue, 1 Jan 2019 15:23:24 -0500 From: Tom Lane To: "David G. Johnston" cc: =?UTF-8?Q?R=C3=A9al_A=2E_Carbonneau?= , "pgsql-bugs@postgresql.org" Subject: Re: ERROR: cannot change name of view column In-reply-to: References: <6692.1546366709@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Tue, 01 Jan 2019 12:35:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <11493.1546374204.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Jan 2019 15:23:24 -0500 Message-ID: <11494.1546374204@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: > On Tuesday, January 1, 2019, R=C3=A9al A. Carbonneau > wrote: >> Since CREATE ... OR REPLACE is literally: "if exists, drop and create, >> else, create", > It=E2=80=99s specifically saying =E2=80=9Creplace the query used for the= view without > changing the view signature/type=E2=80=9D. 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