From: | Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> |
---|---|
To: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_views.definition |
Date: | 2002-07-17 01:44:39 |
Message-ID: | Pine.LNX.4.21.0207171143390.9723-100000@linuxworld.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 17 Jul 2002, Christopher Kings-Lynne wrote:
> > > We do, but as soon as you break the view by dropping an underlying
> > > object it fails to reconstruct. So having the original view definition
> > > at hand could be useful for some ALTER VIEW RECOMPILE command.
> >
> > Note that the assumptions underlying this discussion have changed in
> > CVS tip: you can't break a view by dropping underlying objects.
> >
> > regression=# create table foo(f1 int, f2 text);
> > CREATE TABLE
> > regression=# create view bar as select * from foo;
> > CREATE VIEW
> > regression=# drop table foo;
> > NOTICE: rule _RETURN on view bar depends on table foo
> > NOTICE: view bar depends on rule _RETURN on view bar
> > ERROR: Cannot drop table foo because other objects depend on it
> > Use DROP ... CASCADE to drop the dependent objects too
>
> Hrm - looks like we really need CREATE OR REPLACE VIEW...
I have written a patch for this. It is in an old source tree. I intend on
getting it together by august, along with create or replace trigger.
Gavin
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Kings-Lynne | 2002-07-17 02:07:44 | Re: pg_views.definition |
Previous Message | Christopher Kings-Lynne | 2002-07-17 01:43:45 | Re: Do we still need these NOTICEs? |