<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Partition functions</title>
    <link>/en/sql-reference/functions/management-functions/partition-functions/</link>
    <description>Recent content in Partition functions on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/management-functions/partition-functions/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: CALENDAR_HIERARCHY_DAY</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/calendar-hierarchy-day/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/calendar-hierarchy-day/</guid>
      <description>
        
        
        &lt;p&gt;Groups &lt;code&gt;DATE&lt;/code&gt; partition keys into a hierarchy of years, months, and days. The &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/tuple-mover-tm/&#34; title=&#34;The Tuple Mover manages ROS data storage.&#34;&gt;Tuple Mover&lt;/a&gt; regularly evaluates partition keys against the current date and merges partitions as needed into the appropriate year and month partition groups.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CALENDAR_HIERARCHY_DAY( &lt;span class=&#34;code-variable&#34;&gt;partition-expression&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;active-months&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;active-years&lt;/span&gt;] ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;partition-expression&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The &lt;a href=&#34;../../../../../en/sql-reference/data-types/datetime-data-types/date/#&#34;&gt;DATE&lt;/a&gt; expression on which to group partition keys, which must be identical to the table&#39;s &lt;code&gt;PARTITION BY&lt;/code&gt; expression.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;active-months&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;How many months preceding the current month to store unique partition keys in separate partitions, a positive integer.
&lt;p&gt;A value of 1 means only partition keys of the current month are stored in separate partitions.&lt;/p&gt;
&lt;p&gt;A value of 0 means all partition keys of the current month are merged into a partition group for that month.&lt;/p&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../../../en/admin/partitioning-tables/hierarchical-partitioning/#&#34;&gt;Hierarchical partitioning&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 2&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;active-years&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;How many years preceding the current year to partition group keys by month in separate partitions, a positive integer.
&lt;p&gt;A value of 1 means only partition keys of the current year are stored in month partition groups.&lt;/p&gt;
&lt;p&gt;A value of 0 means all partition keys of the current and previous years are merged into year partition groups.&lt;/p&gt;
&lt;p&gt;For details, see &lt;a href=&#34;../../../../../en/admin/partitioning-tables/hierarchical-partitioning/#&#34;&gt;Hierarchical partitioning&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 2&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;

&lt;div class=&#34;admonition important&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Important&lt;/h4&gt;
&lt;p&gt;The CALENDAR_HIERARCHY_DAY &lt;a href=&#34;../../../../../en/admin/partitioning-tables/hierarchical-partitioning/#GroupingDateDataHierarchically&#34;&gt;algorithm&lt;/a&gt; assumes that most table activity is focused on recent dates. Setting &lt;em&gt;&lt;code&gt;active-years&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;active-months&lt;/code&gt;&lt;/em&gt; to a low number ≥ 2 serves to isolate most merge activity to date-specific containers, and incurs minimal overhead. Vertica recommends that you use the default setting of 2 for &lt;em&gt;&lt;code&gt;active-years&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;active-months&lt;/code&gt;&lt;/em&gt;. For most users, these settings achieve an optimal balance between ROS storage and performance.&lt;/p&gt;
&lt;p&gt;As a best practice, never set &lt;em&gt;&lt;code&gt;active-years&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;active-months&lt;/code&gt;&lt;/em&gt; to 0.&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;
&lt;p&gt;Use this function in the &lt;code&gt;GROUP BY&lt;/code&gt; expression of a table &lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/partition-clause/&#34;&gt;partition clause&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION BY &lt;span class=&#34;code-variable&#34;&gt;partition-expression&lt;/span&gt;
  GROUP BY CALENDAR_HIERARCHY_DAY(
     &lt;span class=&#34;code-variable&#34;&gt;&lt;span class=&#34;code-variable&#34;&gt;group-expression&lt;/span&gt;&lt;/span&gt; [, &lt;span class=&#34;code-variable&#34;&gt;active-months&lt;/span&gt;[, &lt;span class=&#34;code-variable&#34;&gt;active-years&lt;/span&gt;] ] )
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;CREATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TABLE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;store_orders&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;order_no&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;int&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;order_date&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;timestamp&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;NOT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;NULL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;shipper&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;varchar&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;20&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ship_date&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;ALTER&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;TABLE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;store_orders&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;PARTITION&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BY&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;order_date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;DATE&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;      &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;GROUP&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;BY&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;CALENDAR_HIERARCHY_DAY&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;order_date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;DATE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;REORGANIZE&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a name=&#34;Evaluati&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/partitioning-tables/hierarchical-partitioning/#&#34;&gt;Hierarchical partitioning&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: COPY_PARTITIONS_TO_TABLE</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/</guid>
      <description>
        
        
        &lt;p&gt;Copies partitions from one table to another. This lightweight partition copy increases performance by initially sharing the same storage between two tables. After the copy operation is complete, the tables are independent of each other. Users can perform operations on one table without impacting the other. These operations can increase the overall storage required for both tables.

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

Although they share storage space, OpenText™ Analytics Database considers the partitions as discrete objects for license capacity purposes. For example, copying a one TB partition would only consume one TB of space. Your database license, however, considers them as separate objects consuming two TB of space.

&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;COPY_PARTITIONS_TO_TABLE (
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;source-table&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target-table&lt;/span&gt;&amp;#39;
     [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;force-split&lt;/span&gt;&amp;#39;]
)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;{ &lt;/code&gt;&lt;em&gt;&lt;code&gt;namespace.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; | &lt;/code&gt;&lt;em&gt;&lt;code&gt;database.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; }&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the database or &lt;a href=&#34;../../../../../en/architecture/eon-concepts/shards-and-subscriptions/&#34;&gt;namespace&lt;/a&gt; that contains &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Database name: If specified, it must be the current database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Namespace name (Eon Mode only): You must specify the namespace of objects in non-default namespaces. If no namespace is provided, it is assumed the object is in the default namespace.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Eon Mode databases, the namespaces of &lt;em&gt;&lt;code&gt;staging-table&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt; must have the same shard count.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the schema, by default &lt;code&gt;public&lt;/code&gt;. If you specify the namespace or database name, you must provide the schema name, even if the schema is &lt;code&gt;public&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The source table of the partitions to copy.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys to copy, where &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt;. To specify a single partition key, &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt; must be equal.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target table of the partitions to copy. If the table does not exist, Vertica creates a table from the source table&#39;s definition, by calling 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/#&#34;&gt;CREATE TABLE&lt;/a&gt;&lt;/code&gt; with &lt;code&gt;LIKE&lt;/code&gt; and &lt;code&gt;INCLUDING PROJECTIONS&lt;/code&gt; clause. The new table inherits ownership from the source table. For details, see &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/creating-table-from-other-tables/replicating-table/#&#34;&gt;Replicating a table&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;force-split&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Optional Boolean argument, specifies whether to split ROS containers if the range of partition keys spans multiple containers or part of a single container:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt;: Split ROS containers as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; (default): Return with an error if ROS containers must be split to implement this operation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser, one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Owner of source and target tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;TRUNCATE (if force-split is true) and SELECT on the source table, INSERT on the target table&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the target table does not exist, you must also have CREATE privileges on the target schema to enable table creation.&lt;/p&gt;
&lt;h2 id=&#34;table-attribute-requirements&#34;&gt;Table attribute requirements&lt;/h2&gt;
&lt;p&gt;The following attributes of both tables must be identical:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Column definitions, including NULL/NOT NULL constraints&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Segmentation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/partition-clause/&#34;&gt;Partition clause&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number of projections&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Shard count (Eon Mode only)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projection sort order&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Primary and unique key constraints. However, the key constraints do not have to be identically enabled. For more information on constraints, see &lt;a href=&#34;../../../../../en/admin/constraints/#&#34;&gt;Constraints&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the target table has primary or unique key constraints enabled and copying or moving the partitions will insert duplicate key values into the target table, Vertica rolls back the operation.

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check constraints. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt; and &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/#&#34;&gt;COPY_PARTITIONS_TO_TABLE&lt;/a&gt;, Vertica enforces enabled check constraints on the target table only. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/#&#34;&gt;SWAP_PARTITIONS_BETWEEN_TABLES&lt;/a&gt;, Vertica enforces enabled check constraints on both tables. If there is a violation of an enabled check constraint, Vertica rolls back the operation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number and definitions of text indices.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, If access policies exist on the source table, the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Access policies on both tables must be identical.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One of the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The executing user owns the source table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AccessPolicyManagementSuperuserOnly&lt;/code&gt; is set to true. See &lt;a href=&#34;../../../../../en/admin/db-users-and-privileges/access-policies/managing-access-policies/#&#34;&gt;Managing access policies&lt;/a&gt; for details.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;table-restrictions&#34;&gt;Table restrictions&lt;/h2&gt;
&lt;p&gt;The following restrictions apply to the source and target tables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the source and target partitions are in different storage tiers, Vertica returns a warning but the operation proceeds. The partitions remain in their existing storage tier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The target table cannot be &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/immutable-tables/&#34;&gt;immutable&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The following tables cannot be used as sources or targets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Temporary tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Virtual tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;System tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;External tables&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;If you call &lt;code&gt;COPY_PARTITIONS_TO_TABLE&lt;/code&gt; and the target table does not exist, the function creates the table automatically. In the following example, the target table &lt;code&gt;partn_backup.tradfes_200801&lt;/code&gt; does not exist. &lt;code&gt;COPY_PARTITIONS_TO_TABLE&lt;/code&gt; creates the table and replicates the partition. The database also copies all the constraints associated with the source table except foreign key constraints.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT COPY_PARTITIONS_TO_TABLE (
          &amp;#39;prod_trades&amp;#39;,
          &amp;#39;200801&amp;#39;,
          &amp;#39;200801&amp;#39;,
          &amp;#39;partn_backup.trades_200801&amp;#39;);
COPY_PARTITIONS_TO_TABLE
-------------------------------------------------
 1 distinct partition values copied at epoch 15.
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/admin/partitioning-tables/managing-partitions/archiving-partitions/#&#34;&gt;Archiving partitions&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DROP_PARTITIONS</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/drop-partitions/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/drop-partitions/</guid>
      <description>
        
        
        
&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

This function supersedes meta-function DROP_PARTITION, which was deprecated in OpenText™ Analytics Database 9.0.

&lt;/div&gt;
&lt;p&gt;Drops the specified table partition keys.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DROP_PARTITIONS (
    &amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39;
    [, &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;force-split&lt;/span&gt;&amp;#39;]
)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target table. The table cannot be used as a dimension table in a pre-join projection and cannot have out-of-date (unrefreshed) projections.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys to drop, where &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt;. To specify a single partition key, &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt; must be equal.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;force-split&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Optional Boolean argument, specifies whether to split ROS containers if the range of partition keys spans multiple containers or part of a single container:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt;: Split ROS containers as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; (default): Return with an error if ROS containers must be split to implement this operation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

In rare cases, DROP_PARTITIONS executes at the same time as a &lt;a href=&#34;../../../../../en/admin/managing-db/tuple-mover/mergeout/&#34;&gt;mergeout&lt;/a&gt; operation on the same ROS container. As a result, the function cannot split the container as specified and returns with an error. When this happens, call DROP_PARTITIONS again.

&lt;/div&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;One of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;DBADMIN&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privileges on the table schema and TRUNCATE privileges on the table&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/partitioning-tables/managing-partitions/dropping-partitions/#&#34;&gt;Dropping partitions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-table/#&#34;&gt;PARTITION_TABLE&lt;/a&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DUMP_PROJECTION_PARTITION_KEYS</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/dump-projection-partition-keys/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/dump-projection-partition-keys/</guid>
      <description>
        
        
        &lt;p&gt;Dumps the partition keys of the specified projection.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DUMP_PROJECTION_PARTITION_KEYS( &amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;projection-name&lt;/span&gt;&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Projection name&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser: TRUNCATE on anchor table&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following statements create the table and projection &lt;code&gt;online_sales.online_sales_fact&lt;/code&gt; and &lt;code&gt;online_sales.online_sales_fact_rep&lt;/code&gt;, respectively, and partitions table data by the column &lt;code&gt;call_center_key&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE online_sales.online_sales_fact
(
    sale_date_key int NOT NULL,
    ship_date_key int NOT NULL,
    product_key int NOT NULL,
    product_version int NOT NULL,
    customer_key int NOT NULL,
    call_center_key int NOT NULL,
    online_page_key int NOT NULL,
    shipping_key int NOT NULL,
    warehouse_key int NOT NULL,
    promotion_key int NOT NULL,
    pos_transaction_number int NOT NULL,
    sales_quantity int,
    sales_dollar_amount float,
    ship_dollar_amount float,
    net_dollar_amount float,
    cost_dollar_amount float,
    gross_profit_dollar_amount float,
    transaction_type varchar(16)
)
PARTITION BY (online_sales_fact.call_center_key);

=&amp;gt; CREATE PROJECTION online_sales.online_sales_fact_rep AS SELECT * from online_sales.online_sales_fact unsegmented all nodes;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The following DUMP_PROJECTION_PARTITION_KEYS statement dumps the partition key from the projection &lt;code&gt;online_sales.online_sales_fact_rep&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DUMP_PROJECTION_PARTITION_KEYS(&amp;#39;online_sales.online_sales_fact_rep&amp;#39;);

Partition keys on node v_vmart_node0001
  Projection &amp;#39;online_sales_fact_rep&amp;#39;
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 200
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 199
   ...
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 2
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 1

 Partition keys on node v_vmart_node0002
  Projection &amp;#39;online_sales_fact_rep&amp;#39;
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 200
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: 199
...
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/partitioning-tables/#&#34;&gt;Partitioning tables&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/db-functions/dump-partition-keys/#&#34;&gt;DUMP_PARTITION_KEYS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/dump-table-partition-keys/#&#34;&gt;DUMP_TABLE_PARTITION_KEYS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-projection/#&#34;&gt;PARTITION_PROJECTION&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-table/#&#34;&gt;PARTITION_TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: DUMP_TABLE_PARTITION_KEYS</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/dump-table-partition-keys/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/dump-table-partition-keys/</guid>
      <description>
        
        
        &lt;p&gt;Dumps the partition keys of all projections for the specified table.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DUMP_TABLE_PARTITION_KEYS ( &amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt;&amp;#39; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the table&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser: TRUNCATE on table&lt;/p&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example creates a simple table called &lt;code&gt;states&lt;/code&gt; and partitions the data by state:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE states (year INTEGER NOT NULL,
       state VARCHAR NOT NULL)
       PARTITION BY state;
=&amp;gt; CREATE PROJECTION states_p (state, year) AS
       SELECT * FROM states
       ORDER BY state, year UNSEGMENTED ALL NODES;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now dump the partition keys of all projections anchored on table &lt;code&gt;states&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT DUMP_TABLE_PARTITION_KEYS( &amp;#39;states&amp;#39; );
      DUMP_TABLE_PARTITION_KEYS                                                               --------------------------------------------------------------------------------------------
 Partition keys on node v_vmart_node0001
  Projection &amp;#39;states_p&amp;#39;
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: VT
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: PA
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: NY
   Storage [ROS container]
     No of partition keys: 1
     Partition keys: MA

 Partition keys on node v_vmart_node0002
...
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/dump-projection-partition-keys/#&#34;&gt;DUMP_PROJECTION_PARTITION_KEYS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/dump-table-partition-keys/#&#34;&gt;DUMP_TABLE_PARTITION_KEYS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-projection/#&#34;&gt;PARTITION_PROJECTION&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-table/#&#34;&gt;PARTITION_TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/partitioning-tables/#&#34;&gt;Partitioning tables&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: MOVE_PARTITIONS_TO_TABLE</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/</guid>
      <description>
        
        
        &lt;p&gt;Moves partitions from one table to another.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;MOVE_PARTITIONS_TO_TABLE (
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;source-table&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target-table&lt;/span&gt;&amp;#39;
     [, &lt;span class=&#34;code-variable&#34;&gt;force-split&lt;/span&gt;]
)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;{ &lt;/code&gt;&lt;em&gt;&lt;code&gt;namespace.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; | &lt;/code&gt;&lt;em&gt;&lt;code&gt;database.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; }&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the database or &lt;a href=&#34;../../../../../en/architecture/eon-concepts/shards-and-subscriptions/&#34;&gt;namespace&lt;/a&gt; that contains &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Database name: If specified, it must be the current database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Namespace name (Eon Mode only): You must specify the namespace of objects in non-default namespaces. If no namespace is provided, it is assumed the object is in the default namespace.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Eon Mode databases, the namespaces of &lt;em&gt;&lt;code&gt;staging-table&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt; must have the same shard count.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the schema, by default &lt;code&gt;public&lt;/code&gt;. If you specify the namespace or database name, you must provide the schema name, even if the schema is &lt;code&gt;public&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;source-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The source table of the partitions to move.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys to move, where &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt;. To specify a single partition key, &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt; must be equal.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The target table of the partitions to move. If the table does not exist, Vertica creates a table from the source table&#39;s definition, by calling 
&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/#&#34;&gt;CREATE TABLE&lt;/a&gt;&lt;/code&gt; with &lt;code&gt;LIKE&lt;/code&gt; and &lt;code&gt;INCLUDING PROJECTIONS&lt;/code&gt; clause. The new table inherits ownership from the source table. For details, see &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/creating-table-from-other-tables/replicating-table/#&#34;&gt;Replicating a table&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;force-split&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Optional Boolean argument, specifies whether to split ROS containers if the range of partition keys spans multiple containers or part of a single container:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt;: Split ROS containers as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; (default): Return with an error if ROS containers must be split to implement this operation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser, one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Owner of source and target tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SELECT, TRUNCATE on the source table, INSERT on the target table&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the target table does not exist, you must also have CREATE privileges on the target schema to enable table creation.&lt;/p&gt;
&lt;h2 id=&#34;table-attribute-requirements&#34;&gt;Table attribute requirements&lt;/h2&gt;
&lt;p&gt;The following attributes of both tables must be identical:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Column definitions, including NULL/NOT NULL constraints&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Segmentation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/partition-clause/&#34;&gt;Partition clause&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number of projections&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Shard count (Eon Mode only)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projection sort order&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Primary and unique key constraints. However, the key constraints do not have to be identically enabled. For more information on constraints, see &lt;a href=&#34;../../../../../en/admin/constraints/#&#34;&gt;Constraints&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the target table has primary or unique key constraints enabled and copying or moving the partitions will insert duplicate key values into the target table, Vertica rolls back the operation.

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check constraints. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt; and &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/#&#34;&gt;COPY_PARTITIONS_TO_TABLE&lt;/a&gt;, Vertica enforces enabled check constraints on the target table only. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/#&#34;&gt;SWAP_PARTITIONS_BETWEEN_TABLES&lt;/a&gt;, Vertica enforces enabled check constraints on both tables. If there is a violation of an enabled check constraint, Vertica rolls back the operation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number and definitions of text indices.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, If access policies exist on the source table, the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Access policies on both tables must be identical.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One of the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The executing user owns the source table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AccessPolicyManagementSuperuserOnly&lt;/code&gt; is set to true. See &lt;a href=&#34;../../../../../en/admin/db-users-and-privileges/access-policies/managing-access-policies/#&#34;&gt;Managing access policies&lt;/a&gt; for details.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;table-restrictions&#34;&gt;Table restrictions&lt;/h2&gt;
&lt;p&gt;The following restrictions apply to the source and target tables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the source and target partitions are in different storage tiers, Vertica returns a warning but the operation proceeds. The partitions remain in their existing storage tier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The target table cannot be &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/immutable-tables/&#34;&gt;immutable&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The following tables cannot be used as sources or targets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Temporary tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Virtual tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;System tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;External tables&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/partitioning-tables/managing-partitions/archiving-partitions/#&#34;&gt;Archiving partitions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/#&#34;&gt;COPY_PARTITIONS_TO_TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/#&#34;&gt;SWAP_PARTITIONS_BETWEEN_TABLES&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: PARTITION_PROJECTION</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/partition-projection/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/partition-projection/</guid>
      <description>
        
        
        &lt;p&gt;Splits &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/ros-read-optimized-store/&#34; title=&#34;Read Optimized Store (ROS) is a highly optimized, read-oriented, disk storage structure, organized by projection.&#34;&gt;ROS&lt;/a&gt; containers for a specified projection. &lt;code&gt;PARTITION_PROJECTION&lt;/code&gt; also purges data while partitioning ROS containers if deletes were applied before the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/ancient-history-mark-ahm/&#34; title=&#34;Also known as AHM, the ancient history mark is the oldest epoch whose data is accessible to historical queries.&#34;&gt;AHM&lt;/a&gt; epoch.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION_PROJECTION ( &amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;projection&lt;/span&gt;&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;projection&lt;/code&gt;&lt;/em&gt;``&lt;/dt&gt;
&lt;dd&gt;The projection to partition.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In this example, &lt;code&gt;PARTITION_PROJECTION&lt;/code&gt; forces a split of ROS containers on the &lt;code&gt;states_p&lt;/code&gt; projection:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PARTITION_PROJECTION (&amp;#39;states_p&amp;#39;);
  PARTITION_PROJECTION
------------------------
 Projection partitioned
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-table/#&#34;&gt;PARTITION_TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/partitioning-tables/#&#34;&gt;Partitioning tables&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: PARTITION_TABLE</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/partition-table/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/partition-table/</guid>
      <description>
        
        
        &lt;p&gt;Invokes the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/tuple-mover-tm/&#34; title=&#34;The Tuple Mover manages ROS data storage.&#34;&gt;Tuple Mover&lt;/a&gt; to reorganize ROS storage containers as needed to conform with the current partitioning policy.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PARTITION_TABLE ( &amp;#39;[&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table-name&lt;/span&gt;&amp;#39;)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table-name &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table to partition.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You cannot run &lt;code&gt;PARTITION_TABLE&lt;/code&gt; on a table that is an anchor table for a live aggregate projection or a Top-K projection.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To reorganize storage to conform to a new policy, run &lt;code&gt;PARTITION_TABLE&lt;/code&gt; after changing the partition GROUP BY expression.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/partition-projection/#&#34;&gt;PARTITION_PROJECTION&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/admin/partitioning-tables/defining-partitions/partitioning-existing-table-data/#&#34;&gt;Partitioning existing table data&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: PURGE_PARTITION</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/purge-partition/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/purge-partition/</guid>
      <description>
        
        
        &lt;p&gt;Purges a table partition of deleted rows. Similar to &lt;code&gt;PURGE&lt;/code&gt; and &lt;code&gt;PURGE_PROJECTION&lt;/code&gt;, this function removes deleted data from physical storage so you can reuse the disk space. &lt;code&gt;PURGE_PARTITION&lt;/code&gt; removes data only from the &lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/ancient-history-mark-ahm/&#34; title=&#34;Also known as AHM, the ancient history mark is the oldest epoch whose data is accessible to historical queries.&#34;&gt;AHM&lt;/a&gt; epoch and earlier.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;PURGE_PARTITION ( &amp;#39;[[&lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;schema&lt;/span&gt;.]&lt;span class=&#34;code-variable&#34;&gt;table&lt;/span&gt;&amp;#39;, &lt;span class=&#34;code-variable&#34;&gt;partition-key&lt;/span&gt; )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;[&lt;/code&gt;&lt;em&gt;&lt;code&gt;database&lt;/code&gt;&lt;/em&gt;&lt;code&gt;.]&lt;/code&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Database and &lt;a href=&#34;../../../../../en/admin/configuring-db/designing-logical-schema/using-multiple-schemas/setting-search-paths/&#34;&gt;schema&lt;/a&gt;. The default schema is &lt;code&gt;public&lt;/code&gt;. If you specify a database, it must be the current database.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The partitioned table to purge.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;partition-key &lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The key of the partition to purge.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Table owner&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;USAGE privilege on schema&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;The following example lists the count of deleted rows for each partition in a table, then calls &lt;code&gt;PURGE_PARTITION()&lt;/code&gt; to purge the deleted rows from the data.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT partition_key,table_schema,projection_name,sum(deleted_row_count)
   AS deleted_row_count FROM partitions
   GROUP BY partition_key,table_schema,projection_name
   ORDER BY partition_key;

 partition_key | table_schema | projection_name | deleted_row_count
---------------+--------------+-----------------+-------------------
 0             | public       | t_super         |                 2
 1             | public       | t_super         |                 2
 2             | public       | t_super         |                 2
 3             | public       | t_super         |                 2
 4             | public       | t_super         |                 2
 5             | public       | t_super         |                 2
 6             | public       | t_super         |                 2
 7             | public       | t_super         |                 2
 8             | public       | t_super         |                 2
 9             | public       | t_super         |                 1
(10 rows)
=&amp;gt; SELECT PURGE_PARTITION(&amp;#39;t&amp;#39;,5); -- Purge partition with key 5.
                            purge_partition
------------------------------------------------------------------------
 Task: merge partitions
(Table: public.t) (Projection: public.t_super)
(1 row)

=&amp;gt; SELECT partition_key,table_schema,projection_name,sum(deleted_row_count)
   AS deleted_row_count FROM partitions
   GROUP BY partition_key,table_schema,projection_name
   ORDER BY partition_key;


 partition_key | table_schema | projection_name | deleted_row_count
---------------+--------------+-----------------+-------------------
 0             | public       | t_super         |                 2
 1             | public       | t_super         |                 2
 2             | public       | t_super         |                 2
 3             | public       | t_super         |                 2
 4             | public       | t_super         |                 2
 5             | public       | t_super         |                 0
 6             | public       | t_super         |                 2
 7             | public       | t_super         |                 2
 8             | public       | t_super         |                 2
 9             | public       | t_super         |                 1
(10 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/db-functions/purge/#&#34;&gt;PURGE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/projection-functions/purge-projection/#&#34;&gt;PURGE_PROJECTION&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/table-functions/purge-table/#&#34;&gt;PURGE_TABLE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/system-tables/v-monitor-schema/storage-containers/#&#34;&gt;STORAGE_CONTAINERS&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

      </description>
    </item>
    
    <item>
      <title>Sql-Reference: SWAP_PARTITIONS_BETWEEN_TABLES</title>
      <link>/en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/</guid>
      <description>
        
        
        &lt;p&gt;Swaps partitions between two tables.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;SWAP_PARTITIONS_BETWEEN_TABLES (
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;staging-table&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;min-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;&lt;span class=&#34;code-variable&#34;&gt;max-range-value&lt;/span&gt;&amp;#39;,
    &amp;#39;[[{&lt;span class=&#34;code-variable&#34;&gt;namespace&lt;/span&gt;. | &lt;span class=&#34;code-variable&#34;&gt;database&lt;/span&gt;. }]&lt;span class=&#34;code-variable&#34;&gt;schema.&lt;/span&gt;]&lt;span class=&#34;code-variable&#34;&gt;target-table&lt;/span&gt;&amp;#39;
     [, &lt;span class=&#34;code-variable&#34;&gt;force-split&lt;/span&gt;]
)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;{ &lt;/code&gt;&lt;em&gt;&lt;code&gt;namespace.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; | &lt;/code&gt;&lt;em&gt;&lt;code&gt;database.&lt;/code&gt;&lt;/em&gt;&lt;code&gt; }&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the database or &lt;a href=&#34;../../../../../en/architecture/eon-concepts/shards-and-subscriptions/&#34;&gt;namespace&lt;/a&gt; that contains &lt;em&gt;&lt;code&gt;table&lt;/code&gt;&lt;/em&gt;:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Database name: If specified, it must be the current database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Namespace name (Eon Mode only): You must specify the namespace of objects in non-default namespaces. If no namespace is provided, it is assumed the object is in the default namespace.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Eon Mode databases, the namespaces of &lt;em&gt;&lt;code&gt;staging-table&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt; must have the same shard count.&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;schema&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Name of the schema, by default &lt;code&gt;public&lt;/code&gt;. If you specify the namespace or database name, you must provide the schema name, even if the schema is &lt;code&gt;public&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;staging-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The staging table from which to swap partitions.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;min-range-value&lt;/code&gt;&lt;/em&gt;, &lt;em&gt;&lt;code&gt;max-range-value&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The minimum and maximum value of partition keys to swap, where &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; must be ≤ &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt;. To specify a single partition key, &lt;em&gt;&lt;code&gt;min‑range‑value&lt;/code&gt;&lt;/em&gt; and &lt;em&gt;&lt;code&gt;max‑range‑value&lt;/code&gt;&lt;/em&gt; must be equal.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;target-table&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table to which the partitions are to be swapped. The target table cannot be the same as the staging table.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;force-split&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;p&gt;Optional Boolean argument, specifies whether to split ROS containers if the range of partition keys spans multiple containers or part of a single container:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;true&lt;/code&gt;: Split ROS containers as needed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;false&lt;/code&gt; (default): Return with an error if ROS containers must be split to implement this operation.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superuser, one of the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Owner of source and target tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Target and source tables: TRUNCATE, INSERT, SELECT&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;requirements&#34;&gt;Requirements&lt;/h2&gt;
&lt;p&gt;The following attributes of both tables must be identical:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Column definitions, including NULL/NOT NULL constraints&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Segmentation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;../../../../../en/sql-reference/statements/create-statements/create-table/partition-clause/&#34;&gt;Partition clause&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number of projections&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Shard count (Eon Mode only)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Projection sort order&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Primary and unique key constraints. However, the key constraints do not have to be identically enabled. For more information on constraints, see &lt;a href=&#34;../../../../../en/admin/constraints/#&#34;&gt;Constraints&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&#34;alert admonition note&#34; role=&#34;alert&#34;&gt;
&lt;h4 class=&#34;admonition-head&#34;&gt;Note&lt;/h4&gt;

If the target table has primary or unique key constraints enabled and copying or moving the partitions will insert duplicate key values into the target table, Vertica rolls back the operation.

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check constraints. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/move-partitions-to-table/#&#34;&gt;MOVE_PARTITIONS_TO_TABLE&lt;/a&gt; and &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/copy-partitions-to-table/#&#34;&gt;COPY_PARTITIONS_TO_TABLE&lt;/a&gt;, Vertica enforces enabled check constraints on the target table only. For &lt;a href=&#34;../../../../../en/sql-reference/functions/management-functions/partition-functions/swap-partitions-between-tables/#&#34;&gt;SWAP_PARTITIONS_BETWEEN_TABLES&lt;/a&gt;, Vertica enforces enabled check constraints on both tables. If there is a violation of an enabled check constraint, Vertica rolls back the operation.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Number and definitions of text indices.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, If access policies exist on the source table, the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Access policies on both tables must be identical.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;One of the following must be true:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The executing user owns the target table.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;AccessPolicyManagementSuperuserOnly&lt;/code&gt; is set to true.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;restrictions&#34;&gt;Restrictions&lt;/h2&gt;
&lt;p&gt;The following restrictions apply to the source and target tables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the source and target partitions are in different storage tiers, Vertica returns a warning but the operation proceeds. The partitions remain in their existing storage tier.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The target table cannot be &lt;a href=&#34;../../../../../en/admin/working-with-native-tables/immutable-tables/&#34;&gt;immutable&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The following tables cannot be used as sources or targets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Temporary tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Virtual tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;System tables&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;External tables&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;See &lt;a href=&#34;../../../../../en/admin/partitioning-tables/managing-partitions/swapping-partitions/#&#34;&gt;Swapping partitions&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
  </channel>
</rss>
