Skip site navigation (1) Skip section navigation (2)

Re: create or replace rule/view (fwd)

From: Rod Taylor <rbt(at)zort(dot)ca>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>,PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: create or replace rule/view (fwd)
Date: 2002-08-27 18:56:52
Message-ID: 1030474613.51638.4.camel@jester (view raw or flat)
Thread:
Lists: pgsql-patches
REPLACE VIEW shouldn't change the visible structure at all.  It defeats
the purpose.

So, removing that entire portion and throwing an error when the user
tries would be much more appropriate.


The example shown would break nearly every function, subview, etc. that
was using it at the time.

On Tue, 2002-08-27 at 14:50, Bruce Momjian wrote:
> 
> Can someone address Gavin's concern about UpdateAttributeTuples() so we
> can get this patch into 7.3?  I know a few people have been asking for
> it.
> 
> 
> ---------------------------------------------------------------------------
> 
> Gavin Sherry wrote:
> > Re-sent.
> > 
> > No one else seems to have received it.
> > 
> > Bruce: copied you in to make sure.
> > 
> > Gavin
> > 
> > ---------- Forwarded message ----------
> > Date: Mon, 12 Aug 2002 03:22:08 +1000 (EST)
> > From: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
> > To: pgsql-patches(at)postgresql(dot)org
> > Subject: create or replace rule/view
> > 
> > Attached is a patch implementing:
> > 
> > create or replace rule ...
> > create or replace view ...
> > 
> > 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.
> > 
> > It is important to have this functionality so that you can do something
> > like:
> > 
> > template1=# create view abc as select 'test'::text as a;
> > CREATE VIEW
> > template1=# select * from abc;
> >   a
> > ------
> >  test
> > (1 row)
> > 
> > template1=# create or replace view abc as select '1'::int2 as a;
> > CREATE VIEW
> > template1=# select * from abc;
> >  a
> > ---
> >  1
> > (1 row)
> > 
> > Regardless, the patch may need some cleaning up. Unfortunately, I don't
> > have enough time on my hands over the coming week. Considering beta is
> > coming up I thought it best to submit and see what happens.
> > 
> > Gavin
> 
> Content-Description: 
> 
> [ Attachment, skipping... ]
> 
> -- 
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
> ----
> 

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)



In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-08-27 19:24:36
Subject: Re: psql: show which tables contraints are for with a \d
Previous:From: Bruce MomjianDate: 2002-08-27 18:50:39
Subject: Re: create or replace rule/view (fwd)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group