Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Kevin Grittner <kgrittn(at)postgresql(dot)org>, "pgsql-committers(at)postgresql(dot)org" <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add infrastructure to support EphemeralNamedRelation references.
Date: 2017-04-07 16:06:37
Message-ID: CACjxUsP5SiteqKJq3um+RvLkRX+k02b+5BHgnc8VsgdSFj2V-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Thu, Apr 6, 2017 at 6:10 PM, Kevin Grittner <kgrittn(at)gmail(dot)com> wrote:

> * About JOINs and dropped columns: although the parser never includes an
> * already-dropped column in a JOIN RTE's alias var list, it is possible for
> * such a list in a stored rule to include references to dropped columns.
> * (If the column is not explicitly referenced anywhere else in the query,
> * the dependency mechanism won't consider it used by the rule and so won't
> * prevent the column drop.) To support get_rte_attribute_is_dropped(), we
> * replace join alias vars that reference dropped columns with null pointers.

test=# create table t1 (t1id int not null, t1desc text);
CREATE TABLE
test=# create table t2 (t1id int not null, t2id int not null, t2desc text);
CREATE TABLE
test=# create view v1 as select t2desc from t1 join t2 on t1.t1id = t2.t1id;
CREATE VIEW
test=# alter table t1 drop column t1id;
ERROR: cannot drop table t1 column t1id because other objects depend on it
DETAIL: view v1 depends on table t1 column t1id
HINT: Use DROP ... CASCADE to drop the dependent objects too.

Is that comment wrong?

--
Kevin Grittner

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-04-07 16:18:48 pgsql: Fix planner error (or assert trap) with nested set operations.
Previous Message Heikki Linnakangas 2017-04-07 11:58:10 pgsql: Use SASLprep to normalize passwords for SCRAM authentication.