3
.\" Author: The PostgreSQL Global Development Group
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
6
.\" Manual: PostgreSQL 9.1beta1 Documentation
7
.\" Source: PostgreSQL 9.1beta1
10
.TH "ALTER VIEW" "7" "2011-04-27" "PostgreSQL 9.1beta1" "PostgreSQL 9.1beta1 Documentation"
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
14
.\" disable hyphenation
16
.\" disable justification (adjust text to left margin only)
18
.\" -----------------------------------------------------------------
19
.\" * MAIN CONTENT STARTS HERE *
20
.\" -----------------------------------------------------------------
22
ALTER_VIEW \- change the definition of a view
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
36
changes various auxiliary properties of a view\&. (If you want to modify the view\(aqs defining query, use
37
CREATE OR REPLACE VIEW\&.)
39
You must own the view to use
40
ALTER VIEW\&. To change a view\(aqs schema, you must also have
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
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\&.)
49
The name (optionally schema\-qualified) of an existing view\&.
54
These forms set or remove the default value for a column\&. A default value associated with a view column is inserted into
56
statements on the view before the view\(aqs
58
rule is applied, if the
60
does not specify a value for the column\&.
65
The user name of the new owner of the view\&.
70
The new name for the view\&.
75
The new schema for the view\&.
79
For historical reasons,
81
can be used with views too; but the only variants of
83
that are allowed with views are equivalent to the ones shown above\&.
95
ALTER VIEW foo RENAME TO bar;
105
extension of the SQL standard\&.
107
CREATE VIEW (\fBCREATE_VIEW\fR(7)), DROP VIEW (\fBDROP_VIEW\fR(7))