@@ -3915,18 +3915,25 @@ DROP TABLE measurement_y2006m02;
3915
3915
<para>
3916
3916
Another option that is often preferable is to remove the partition from
3917
3917
the partitioned table but retain access to it as a table in its own
3918
- right:
3918
+ right. This has two forms :
3919
3919
3920
3920
<programlisting>
3921
3921
ALTER TABLE measurement DETACH PARTITION measurement_y2006m02;
3922
+ ALTER TABLE measurement DETACH PARTITION measurement_y2006m02 CONCURRENTLY;
3922
3923
</programlisting>
3923
3924
3924
- This allows further operations to be performed on the data before
3925
+ These allow further operations to be performed on the data before
3925
3926
it is dropped. For example, this is often a useful time to back up
3926
3927
the data using <command>COPY</command>, <application>pg_dump</application>, or
3927
3928
similar tools. It might also be a useful time to aggregate data
3928
3929
into smaller formats, perform other data manipulations, or run
3929
- reports.
3930
+ reports. The first form of the command requires an
3931
+ <literal>ACCESS EXCLUSIVE</literal> lock on the parent table.
3932
+ Adding the <literal>CONCURRENTLY</literal> qualifier as in the second
3933
+ form allows the detach operation to require only
3934
+ <literal>SHARE UPDATE EXCLUSIVE</literal> lock on the parent table, but see
3935
+ <link linkend="sql-altertable-detach-partition"><literal>ALTER TABLE ... DETACH PARTITION</literal></link>
3936
+ for details on the restrictions.
3930
3937
</para>
3931
3938
3932
3939
<para>
@@ -4163,17 +4170,6 @@ ALTER INDEX measurement_city_id_logdate_key
4163
4170
might be poor.)
4164
4171
</para>
4165
4172
</listitem>
4166
-
4167
- <listitem>
4168
- <para>
4169
- Some operations require a stronger lock when using declarative
4170
- partitioning than when using table inheritance. For example,
4171
- removing a partition from a partitioned table requires taking
4172
- an <literal>ACCESS EXCLUSIVE</literal> lock on the parent table,
4173
- whereas a <literal>SHARE UPDATE EXCLUSIVE</literal> lock is enough
4174
- in the case of regular inheritance.
4175
- </para>
4176
- </listitem>
4177
4173
</itemizedlist>
4178
4174
</para>
4179
4175
0 commit comments