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

Re: new relkind for views

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Mark Hollomon <mhh(at)mindspring(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: new relkind for views
Date: 2000-09-12 04:49:10
Message-ID: 200009120449.AAA11103@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Applied.  initdb all, catalog version updated.


> 
> This patch implements a different "relkind"
> for views. Views are now have a "relkind" of
> RELKIND_VIEW instead of RELKIND_RELATION.
> 
> Also, views no longer have actual heap storage
> files.
> 
> The following changes were made
> 
> 1. CREATE VIEW sets the new relkind
> 
> 2. The executor complains if a DELETE or
> 	INSERT references a view.
> 
> 3. DROP RULE complains if an attempt is made
> 	to delete a view SELECT rule.
> 
> 4. CREATE RULE "_RETmytable" AS ON SELECT TO mytable DO INSTEAD ...
> 	1. checks to make sure mytable is empty.
> 	2. sets the relkind to RELKIND_VIEW.
> 	3. deletes the heap storage files.
> 
> 5. LOCK myview is not allowed. :)
> 
> 
> 6. the regression test type_sanity was changed to
> 	account for the new relkind value.
> 
> 7. CREATE INDEX ON myview ... is not allowed.
> 
> 8. VACUUM myview is not allowed.
> 	VACUUM automatically skips views when do the entire
> 	database.
> 
> 9. TRUNCATE myview is not allowed.
> 
> 
> THINGS LEFT TO THINK ABOUT
> 
> o pg_views
> 
> o pg_dump
> 
> o pgsql (\d \dv)
> 
> o Do we really want to be able to inherit from views?
> 
> o Is 'DROP TABLE myview' OK?
> 
> -- 
> Mark Hollomon
> mhh(at)mindspring(dot)com

[ Attachment, skipping... ]


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-patches by date

Next:From: William WebberDate: 2000-09-12 04:50:41
Subject: JDBC: prevent NullPointerException if translations missing
Previous:From: Bruce MomjianDate: 2000-09-12 04:41:27
Subject: Re: Small SSL-related patch...

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