Re: create or replace rule/view - Mailing list pgsql-patches

From Tom Lane
Subject Re: create or replace rule/view
Date
Msg-id 19480.1029093406@sss.pgh.pa.us
Whole thread Raw
In response to create or replace rule/view  (Gavin Sherry <swm@linuxworld.com.au>)
List pgsql-patches
Gavin Sherry <swm@linuxworld.com.au> writes:
> It passes all regression tests. There's only one really sketchy part of
> the patch: UpdateAttributeTuples(). This routine is fairly dangerous since
> it simply removes a given relid's pg_attribute entries and creates a new
> set basic on a given TupleDesc. Naturally, it is only useful for views.

You can NOT allow CREATE OR REPLACE VIEW to change the tupledesc of the
view, so I stopped reading right here --- take it out and install
prevention instead.  Why do you think that REPLACE VIEW is interesting?
It's so you can modify a view without breaking things that depend on it
... and things that depend on it depend on the tupledesc.  This is
exactly analogous to not allowing REPLACE FUNCTION to change the return
type of the function.

            regards, tom lane

pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: create or replace rule/view
Next
From: "Dave Page"
Date:
Subject: Re: CREATE OR REPLACE TRIGGER