From 1471e3843d04797ff117f84f6331b8b2e8fdd787 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 21 Oct 2008 08:38:16 +0000 Subject: Allow SQL:2008 syntax ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE alongside our traditional syntax. --- doc/src/sgml/ref/alter_table.sgml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index ab929728a7f..c7288413a99 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1,5 +1,5 @@ @@ -33,7 +33,7 @@ where action is one of: ADD [ COLUMN ] column type [ column_constraint [ ... ] ] DROP [ COLUMN ] column [ RESTRICT | CASCADE ] - ALTER [ COLUMN ] column TYPE type [ USING expression ] + ALTER [ COLUMN ] column [ SET DATA ] TYPE type [ USING expression ] ALTER [ COLUMN ] column SET DEFAULT expression ALTER [ COLUMN ] column DROP DEFAULT ALTER [ COLUMN ] column { SET | DROP } NOT NULL @@ -93,7 +93,7 @@ where action is one of: - ALTER COLUMN TYPE + SET DATA TYPE This form changes the type of a column of a table. Indexes and @@ -760,7 +760,7 @@ ALTER TABLE distributors with time zone via a USING clause: ALTER TABLE foo - ALTER COLUMN foo_timestamp TYPE timestamp with time zone + ALTER COLUMN foo_timestamp SET DATA TYPE timestamp with time zone USING timestamp with time zone 'epoch' + foo_timestamp * interval '1 second'; @@ -868,8 +868,9 @@ ALTER TABLE myschema.distributors SET SCHEMA yourschema; Compatibility - The ADD, DROP, and SET DEFAULT - forms conform with the SQL standard. The other forms are + The forms ADD, DROP, SET DEFAULT, + and SET DATA TYPE (without USING) + conform with the SQL standard. The other forms are PostgreSQL extensions of the SQL standard. Also, the ability to specify more than one manipulation in a single ALTER TABLE command is an extension. -- cgit v1.2.3