Postgres Plus Advanced Server Oracle Compatibility Developer's Guide : 12.12 ALTER TABLE… RENAME PARTITION

Previous PageTable Of ContentsNext Page

Postgres Plus Advanced Server Oracle Compatibility Developer's Guide

 

12.12 ALTER TABLE… RENAME PARTITION

Use the ALTER TABLE… RENAME PARTITION command to rename a table partition. The syntax takes two forms:

    ALTER TABLE table_name
    RENAME PARTITION partition_name
    TO new_name;

    and

    ALTER TABLE table_name
    RENAME SUBPARTITION partition_name
    TO
    new_name;

Description

This command makes no distinctions between a partition and a subpartition:

    ● You can rename a partition with the RENAME PARTITION or RENAME SUBPARTITION clause.

    ● You can rename a subpartition with RENAME PARTITION or RENAME SUBPARTITION clause.

You must own a table to invoke ALTER TABLERENAME PARTITION or ALTER TABLE RENAME SUBPARTITION against that table.

Parameters

table_name

The name (optionally schema-qualified) of the table in which the partition resides.

partition_name

The name of the partition or subpartition to be renamed.

new_name

The new name of the partition or subpartition.

Example

The following command renames a partition named (q4) that resides in the sales table to 4th_quarter:

      ALTER TABLE sales
      RENAME PARTITION q4
      TO 4th_quarter;

Previous PageTable Of ContentsNext Page