Skip to content

Commit 2c3e292

Browse files
committed
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
1 parent 39b5e5f commit 2c3e292

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/src/sgml/ref/alter_table.sgml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
719719
</para>
720720

721721
<para>
722-
The fact that <literal>ALTER TYPE</> requires rewriting the whole table
722+
The fact that <literal>SET DATA TYPE</> requires rewriting the whole table
723723
is sometimes an advantage, because the rewriting process eliminates
724724
any dead space in the table. For example, to reclaim the space occupied
725725
by a dropped column immediately, the fastest way is:
@@ -734,15 +734,15 @@ ALTER TABLE table ALTER COLUMN anycol TYPE anytype;
734734
</para>
735735

736736
<para>
737-
The <literal>USING</literal> option of <literal>ALTER TYPE</> can actually
737+
The <literal>USING</literal> option of <literal>SET DATA TYPE</> can actually
738738
specify any expression involving the old values of the row; that is, it
739739
can refer to other columns as well as the one being converted. This allows
740-
very general conversions to be done with the <literal>ALTER TYPE</>
740+
very general conversions to be done with the <literal>SET DATA TYPE</>
741741
syntax. Because of this flexibility, the <literal>USING</literal>
742742
expression is not applied to the column's default value (if any); the
743743
result might not be a constant expression as required for a default.
744744
This means that when there is no implicit or assignment cast from old to
745-
new type, <literal>ALTER TYPE</> might fail to convert the default even
745+
new type, <literal>SET DATA TYPE</> might fail to convert the default even
746746
though a <literal>USING</literal> clause is supplied. In such cases,
747747
drop the default with <literal>DROP DEFAULT</>, perform the <literal>ALTER
748748
TYPE</>, and then use <literal>SET DEFAULT</> to add a suitable new

0 commit comments

Comments
 (0)