Re: create or replace rule/view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: create or replace rule/view
Date: 2002-08-11 19:16:46
Message-ID: 19480.1029093406@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Gavin Sherry <swm(at)linuxworld(dot)com(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Dave Page 2002-08-11 19:17:40 Re: CREATE OR REPLACE TRIGGER
Previous Message Joe Conway 2002-08-11 17:40:51 Re: create or replace rule/view