postgresql/src/backend/tcop
Bruce Momjian 264c068207 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
2000-09-12 04:49:17 +00:00
..
dest.c Remove long-dead support for invoking queries from dynamically loaded 2000-07-08 03:04:41 +00:00
fastpath.c TOAST 2000-07-03 23:10:14 +00:00
Makefile Fix relative path references so that make knowns which dependencies refer 2000-08-31 16:12:35 +00:00
postgres.c Code cleanup of user name and user id handling in the backend. The current 2000-09-06 14:15:31 +00:00
pquery.c Fix a many-legged critter reported by chifungfan@yahoo.com: under the 2000-08-22 04:06:22 +00:00
utility.c This patch implements a different "relkind" 2000-09-12 04:49:17 +00:00