Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b2b2ae

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 typeof a column.Noah Misch
1 parent5042d16 commit2b2b2ae

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
@@ -777,7 +777,7 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable>
777777
</para>
778778

779779
<para>
780-
The fact that <literal>ALTER TYPE</> requires rewriting the whole table
780+
The fact that <literal>SET DATA TYPE</> requires rewriting the whole table
781781
is sometimes an advantage, because the rewriting process eliminates
782782
any dead space in the table. For example, to reclaim the space occupied
783783
by a dropped column immediately, the fastest way is:
@@ -792,15 +792,15 @@ ALTER TABLE table ALTER COLUMN anycol TYPE anytype;
792792
</para>
793793

794794
<para>
795-
The <literal>USING</literal> option of <literal>ALTER TYPE</> can actually
795+
The <literal>USING</literal> option of <literal>SET DATA TYPE</> can actually
796796
specify any expression involving the old values of the row; that is, it
797797
can refer to other columns as well as the one being converted. This allows
798-
very general conversions to be done with the <literal>ALTER TYPE</>
798+
very general conversions to be done with the <literal>SET DATA TYPE</>
799799
syntax. Because of this flexibility, the <literal>USING</literal>
800800
expression is not applied to the column's default value (if any); the
801801
result might not be a constant expression as required for a default.
802802
This means that when there is no implicit or assignment cast from old to
803-
new type, <literal>ALTER TYPE</> might fail to convert the default even
803+
new type, <literal>SET DATA TYPE</> might fail to convert the default even
804804
though a <literal>USING</literal> clause is supplied. In such cases,
805805
drop the default with <literal>DROP DEFAULT</>, perform the <literal>ALTER
806806
TYPE</>, and then use <literal>SET DEFAULT</> to add a suitable new

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp