From 2b2b2ae2aa4a7089aee729e67bb323154da3841a Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 25 Jan 2011 18:50:35 -0500 Subject: [PATCH] Correct ALTER TYPE -> SET DATA TYPE in ALTER TABLE documentation. The latter is the correct name of the operation to change the data type of a column. Noah Misch --- doc/src/sgml/ref/alter_table.sgml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index bba690d523..610a0bc99f 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -777,7 +777,7 @@ ALTER TABLE name - The fact that ALTER TYPE requires rewriting the whole table + The fact that SET DATA TYPE requires rewriting the whole table is sometimes an advantage, because the rewriting process eliminates any dead space in the table. For example, to reclaim the space occupied by a dropped column immediately, the fastest way is: @@ -792,15 +792,15 @@ ALTER TABLE table ALTER COLUMN anycol TYPE anytype; - The USING option of ALTER TYPE can actually + The USING option of SET DATA TYPE can actually specify any expression involving the old values of the row; that is, it can refer to other columns as well as the one being converted. This allows - very general conversions to be done with the ALTER TYPE + very general conversions to be done with the SET DATA TYPE syntax. Because of this flexibility, the USING expression is not applied to the column's default value (if any); the result might not be a constant expression as required for a default. This means that when there is no implicit or assignment cast from old to - new type, ALTER TYPE might fail to convert the default even + new type, SET DATA TYPE might fail to convert the default even though a USING clause is supplied. In such cases, drop the default with DROP DEFAULT, perform the ALTER TYPE, and then use SET DEFAULT to add a suitable new -- 2.39.5