ALTER PROJECTION

Changes the DDL of the specified projection.

Syntax

ALTER PROJECTION [[database.]schema.]projection RENAME TO new‑name

Parameters

schema

Specifies a schema, by default public. If schema is any schema other than public, you must supply the schema name. For example:

myschema.thisDbObject

If you specify a database, it must be the current database.

projection

The projection to change, where projection can be one of the following:

  • Projection base name: Rename all projections that share this base name.
  • Projection name: Rename the specified projection and its base name. If the projection is segmented, its buddies are unaffected by this change.

See Projection Naming for projection name conventions.

new‑name

The new projection name.

Privileges

Non-superuser, CREATE and USAGE on the schema and one of the following:

  • Anchor table owner
  • ALTER privilege on the anchor table

Examples

=> SELECT export_tables('','public.store_orders');

                export_tables
---------------------------------------------
                                                                                                                                                                                                              export_tables                                                                                                                                                                                                                   
CREATE TABLE public.store_orders
(
    order_no int,
    order_date timestamp NOT NULL,
    shipper varchar(20),
    ship_date date NOT NULL
);
(1 row)

=> CREATE PROJECTION store_orders_p AS SELECT * from store_orders;
CREATE PROJECTION
=> ALTER PROJECTION store_orders_p RENAME to store_orders_new;
ALTER PROJECTION