pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Réal A. Carbonneau <contact@realcarbonneau.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: ERROR: cannot change name of view column
Date: Tue, 01 Jan 2019 15:23:24 -0500
Message-ID: <11494.1546374204@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwZo8hdW8E=Vow0qw_qe+gcRKo+Zn3ecXrCxAnHkYAA_LQ@mail.gmail.com>
References: <CAJ-S0v57o6Ltgij0zBRnHLK2ustVsM7XinJJF8geJpamq-ortA@mail.gmail.com>
	<6692.1546366709@sss.pgh.pa.us>
	<CAJ-S0v4S7So_AH30sFkQnR7h_rS2MLLoPTsevLf+t1S2GG0m_g@mail.gmail.com>
	<CAKFQuwZo8hdW8E=Vow0qw_qe+gcRKo+Zn3ecXrCxAnHkYAA_LQ@mail.gmail.com>

"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




view thread (6+ messages)  latest in thread

Message-ID: <11494.1546374204@sss.pgh.pa.us>
Permalink:  ../11494.1546374204@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11494.1546374204@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, contact@realcarbonneau.com
  Subject: Re: ERROR: cannot change name of view column
  In-Reply-To: <11494.1546374204@sss.pgh.pa.us>
  References: <CAJ-S0v57o6Ltgij0zBRnHLK2ustVsM7XinJJF8geJpamq-ortA@mail.gmail.com> <6692.1546366709@sss.pgh.pa.us> <CAJ-S0v4S7So_AH30sFkQnR7h_rS2MLLoPTsevLf+t1S2GG0m_g@mail.gmail.com> <CAKFQuwZo8hdW8E=Vow0qw_qe+gcRKo+Zn3ecXrCxAnHkYAA_LQ@mail.gmail.com> <11494.1546374204@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox