From a55898131e0c68efc5836a6cada8e34e47678b71 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Tue, 3 Jul 2007 01:30:37 +0000 Subject: Add ALTER VIEW ... RENAME TO, and a RENAME TO clause to ALTER SEQUENCE. Sequences and views could previously be renamed using ALTER TABLE, but this was a repeated source of confusion for users. Update the docs, and psql tab completion. Patch from David Fetter; various minor fixes by myself. --- doc/src/sgml/ref/allfiles.sgml | 3 +- doc/src/sgml/ref/alter_sequence.sgml | 29 ++++++++---- doc/src/sgml/ref/alter_view.sgml | 88 ++++++++++++++++++++++++++++++++++++ doc/src/sgml/ref/create_view.sgml | 3 +- doc/src/sgml/ref/drop_view.sgml | 3 +- doc/src/sgml/reference.sgml | 3 +- 6 files changed, 116 insertions(+), 13 deletions(-) create mode 100644 doc/src/sgml/ref/alter_view.sgml (limited to 'doc/src') diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index 90ad9adc53c..3e08b55bab1 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -1,5 +1,5 @@ @@ -25,6 +25,7 @@ Complete list of usable sgml source files in this directory. + diff --git a/doc/src/sgml/ref/alter_sequence.sgml b/doc/src/sgml/ref/alter_sequence.sgml index 37c2ceb6314..c2bc3cd8bf5 100644 --- a/doc/src/sgml/ref/alter_sequence.sgml +++ b/doc/src/sgml/ref/alter_sequence.sgml @@ -1,5 +1,5 @@ @@ -29,6 +29,7 @@ ALTER SEQUENCE name [ INCREMENT [ B [ RESTART [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ] [ OWNED BY { table.column | NONE } ] ALTER SEQUENCE name SET SCHEMA new_schema +ALTER SEQUENCE name RENAME TO new_name @@ -182,14 +183,24 @@ ALTER SEQUENCE name SET SCHEMA - - new_schema - - - The new schema for the sequence. - - - + + new_schema + + + The new schema for the sequence. + + + + + + new_name + + + The new name for the sequence. + + + + diff --git a/doc/src/sgml/ref/alter_view.sgml b/doc/src/sgml/ref/alter_view.sgml new file mode 100644 index 00000000000..62723c70961 --- /dev/null +++ b/doc/src/sgml/ref/alter_view.sgml @@ -0,0 +1,88 @@ + + + + + ALTER VIEW + SQL - Language Statements + + + + ALTER VIEW + change the definition of a view + + + + ALTER VIEW + + + + +ALTER VIEW name RENAME TO newname + + + + + Description + + + ALTER VIEW changes the definition of a + view. To execute this command you must be the owner of the view. + + + + + Parameters + + + + name + + + The name (optionally schema-qualified) of an existing view. + + + + + + newname + + + The new name of the view. + + + + + + + + Examples + + + To rename the view foo to + bar: + +ALTER VIEW foo RENAME TO bar; + + + + + Compatibility + + + ALTER VIEW is a PostgreSQL + extension of the SQL standard. + + + + + See Also + + + + + + + diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index f1466c86780..1ad50f05d2e 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -1,5 +1,5 @@ @@ -226,6 +226,7 @@ CREATE VIEW name [ ( See Also + diff --git a/doc/src/sgml/ref/drop_view.sgml b/doc/src/sgml/ref/drop_view.sgml index 03a8d4aa0e2..b531c6d235b 100644 --- a/doc/src/sgml/ref/drop_view.sgml +++ b/doc/src/sgml/ref/drop_view.sgml @@ -1,5 +1,5 @@ @@ -104,6 +104,7 @@ DROP VIEW kinds; See Also + diff --git a/doc/src/sgml/reference.sgml b/doc/src/sgml/reference.sgml index 06699a5b34b..a52fe7a9644 100644 --- a/doc/src/sgml/reference.sgml +++ b/doc/src/sgml/reference.sgml @@ -1,4 +1,4 @@ - + Reference @@ -53,6 +53,7 @@ &alterTrigger; &alterType; &alterUser; + &alterView; &analyze; &begin; &checkpoint; -- cgit v1.2.3