~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/man7/ALTER_VIEW.7

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: ALTER VIEW
 
3
.\"    Author: The PostgreSQL Global Development Group
 
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
 
5
.\"      Date: 2011-04-27
 
6
.\"    Manual: PostgreSQL 9.1beta1 Documentation
 
7
.\"    Source: PostgreSQL 9.1beta1
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "ALTER VIEW" "7" "2011-04-27" "PostgreSQL 9.1beta1" "PostgreSQL 9.1beta1 Documentation"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * set default formatting
 
13
.\" -----------------------------------------------------------------
 
14
.\" disable hyphenation
 
15
.nh
 
16
.\" disable justification (adjust text to left margin only)
 
17
.ad l
 
18
.\" -----------------------------------------------------------------
 
19
.\" * MAIN CONTENT STARTS HERE *
 
20
.\" -----------------------------------------------------------------
 
21
.SH "NAME"
 
22
ALTER_VIEW \- change the definition of a view
 
23
.\" ALTER VIEW
 
24
.SH "SYNOPSIS"
 
25
.sp
 
26
.nf
 
27
ALTER VIEW \fIname\fR ALTER [ COLUMN ] \fIcolumn\fR SET DEFAULT \fIexpression\fR
 
28
ALTER VIEW \fIname\fR ALTER [ COLUMN ] \fIcolumn\fR DROP DEFAULT
 
29
ALTER VIEW \fIname\fR OWNER TO \fInew_owner\fR
 
30
ALTER VIEW \fIname\fR RENAME TO \fInew_name\fR
 
31
ALTER VIEW \fIname\fR SET SCHEMA \fInew_schema\fR
 
32
.fi
 
33
.SH "DESCRIPTION"
 
34
.PP
 
35
ALTER VIEW
 
36
changes various auxiliary properties of a view\&. (If you want to modify the view\(aqs defining query, use
 
37
CREATE OR REPLACE VIEW\&.)
 
38
.PP
 
39
You must own the view to use
 
40
ALTER VIEW\&. To change a view\(aqs schema, you must also have
 
41
CREATE
 
42
privilege on the new schema\&. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have
 
43
CREATE
 
44
privilege on the view\(aqs schema\&. (These restrictions enforce that altering the owner doesn\(aqt do anything you couldn\(aqt do by dropping and recreating the view\&. However, a superuser can alter ownership of any view anyway\&.)
 
45
.SH "PARAMETERS"
 
46
.PP
 
47
\fIname\fR
 
48
.RS 4
 
49
The name (optionally schema\-qualified) of an existing view\&.
 
50
.RE
 
51
.PP
 
52
SET/DROP DEFAULT
 
53
.RS 4
 
54
These forms set or remove the default value for a column\&. A default value associated with a view column is inserted into
 
55
INSERT
 
56
statements on the view before the view\(aqs
 
57
ON INSERT
 
58
rule is applied, if the
 
59
INSERT
 
60
does not specify a value for the column\&.
 
61
.RE
 
62
.PP
 
63
\fInew_owner\fR
 
64
.RS 4
 
65
The user name of the new owner of the view\&.
 
66
.RE
 
67
.PP
 
68
\fInew_name\fR
 
69
.RS 4
 
70
The new name for the view\&.
 
71
.RE
 
72
.PP
 
73
\fInew_schema\fR
 
74
.RS 4
 
75
The new schema for the view\&.
 
76
.RE
 
77
.SH "NOTES"
 
78
.PP
 
79
For historical reasons,
 
80
ALTER TABLE
 
81
can be used with views too; but the only variants of
 
82
ALTER TABLE
 
83
that are allowed with views are equivalent to the ones shown above\&.
 
84
.SH "EXAMPLES"
 
85
.PP
 
86
To rename the view
 
87
foo
 
88
to
 
89
bar:
 
90
.sp
 
91
.if n \{\
 
92
.RS 4
 
93
.\}
 
94
.nf
 
95
ALTER VIEW foo RENAME TO bar;
 
96
.fi
 
97
.if n \{\
 
98
.RE
 
99
.\}
 
100
.SH "COMPATIBILITY"
 
101
.PP
 
102
ALTER VIEW
 
103
is a
 
104
PostgreSQL
 
105
extension of the SQL standard\&.
 
106
.SH "SEE ALSO"
 
107
CREATE VIEW (\fBCREATE_VIEW\fR(7)), DROP VIEW (\fBDROP_VIEW\fR(7))