Re: Possible enhancement : replace view ? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Possible enhancement : replace view ?
Date
Msg-id 200208140334.g7E3YSa25198@candle.pha.pa.us
Whole thread Raw
In response to Re: Possible enhancement : replace view ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Ah, that's why it wasn't in my mailbox.  Gavin,

http://groups.google.com/groups?hl=en&lr=&ie=ISO-8859-1&q=replace+view+gavin&btnG=Google+Search&meta=group%3Dcomp.databases.postgresql.*


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
---------------------------------------------------------------------------

Tom Lane wrote:
> Gavin Sherry <swm@linuxworld.com.au> writes:
> > I submitted a patch for this a few days ago. Did it not hit pgsql-patches?
> 
> It did ... I had some gripes about it ... I thought you were working on
> the gripes?
> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Temporary Views
Next
From: Bruce Momjian
Date:
Subject: Re: Temporary Views