On 2016/12/01 1:17, Tom Lane wrote:
> Stephen Frost <[email protected]> writes:
>> Seems like this would be a bit better:
>
>> ------
>> All the actions, when acting on a single table and not using the ALL IN
>> TABLESPACE form, except RENAME and SET SCHEMA, can be combined into a
>> list of multiple alterations to be applied.
>> ------
>
>> I note that we say 'in parallel', but given that we have actual parallel
>> operations now, we should probably shy away from using that except in
>> cases where we actually mean operations utilizing multiple parallel
>> processes.
>
> I follow your beef with use of the word "parallel", but your proposed
> rewording loses the entire point of multiple actions per ALTER TABLE;
> namely that they're accomplished without repeated scans of the table.
>
> Also the above seems a bit clunky; doesn't ALL IN TABLESPACE fall outside
> the restriction "acting on a single table"?
>
> So maybe something like
>
> All the forms of ALTER TABLE that act on a single table,
> except RENAME and SET SCHEMA, can be combined into a
> list of multiple alterations to be applied together.
Updated patch attached.
> We would have to enlarge on what "together" means, but I think there may
> already be text explaining that further down.
There is this explanation:
<para>
The main reason for providing the option to specify multiple changes
in a single <command>ALTER TABLE</> is that multiple table scans or
rewrites can thereby be combined into a single pass over the table.
</para>
Thanks,
Amit
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index e48ccf2..9e79e08 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -708,12 +708,11 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable>
</para>
<para>
- All the actions except <literal>RENAME</literal>,
- <literal>SET TABLESPACE</literal> and <literal>SET SCHEMA</literal>
- can be combined into
- a list of multiple alterations to apply in parallel. For example, it
- is possible to add several columns and/or alter the type of several
- columns in a single command. This is particularly useful with large
+ All the forms of <literal>ALTER TABLE</literal> that act on a single table,
+ except <literal>RENAME</literal> and <literal>SET SCHEMA</literal>, can be
+ combined into a list of multiple alterations to be applied together.
+ For example, it is possible to add several columns and/or alter the type of
+ several columns in a single command. This is particularly useful with large
tables, since only one pass over the table need be made.
</para>
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers