home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / ref / postquel / defineview < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.3 KB  |  51 lines

  1. .\" XXX standard disclaimer belongs here....
  2. .\" $Header: /private/postgres/ref/postquel/RCS/defineview,v 1.8 1992/07/14 05:54:17 ptong Exp $
  3. .SP "DEFINE VIEW" COMMANDS 6/14/90
  4. .XA 2 "Define View"
  5. .uh NAME
  6. .lp
  7. define view \*- construct a virtual class
  8. .uh SYNOPSIS
  9. .lp
  10. .(l
  11. \fBdefine view\fR view_name
  12.         \fB(\fR [ dom_name_1 \fB=\fR] expression_1
  13.         {\fB,\fR [dom_name_i \fB=\fR] expression_i} \fB)\fR
  14.     [ \fBfrom\fR from_list ]
  15.     [ \fBwhere\fR qual ]
  16. .)l
  17. .sp
  18. .uh DESCRIPTION
  19. .lp
  20. .b "Define view"
  21. will define a view of a class.
  22. This view is not physically materialized;
  23. instead the rule system is used to support view processing as in [STON90].
  24. Specifically,
  25. a query rewrite retrieve rule is automatically generated
  26. to support retrieve operations on views.
  27. Then,
  28. the user can add as many update rules as he wishes to specify the
  29. processing of update operations to views.
  30. See [STON90] for a detailed discussion of this point.
  31. .uh EXAMPLE
  32. .lp
  33. .nf
  34. .ft C
  35. /* define a view consisting of toy department employees */
  36.  
  37. define view toyemp (e.name)
  38.    from e in emp
  39.    where e.dept = "toy"
  40.  
  41. /* Specify deletion semantics for toyemp */
  42.  
  43. define rewrite rule example1 is
  44.    on delete to toyemp
  45.    then do instead delete emp where emp.OID = current.OID
  46. .ft
  47.  
  48. .uh "SEE ALSO"
  49. .lp
  50. postquel(commands), create(commands), define rule(commands).
  51.