ALTER MODEL

Allows users to rename an existing model, change ownership, or move it to a another schema.

Syntax

ALTER MODEL [[database.]schema.]model
   { OWNER TO owner
     | RENAME TO new‑name
     | SET SCHEMA schema
 }

Parameters

[database.]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.

model

Identifies the model to alter.

OWNER TO owner

Reassigns ownership of this model to owner. If a non-superuser, you must be the current owner.

RENAME TO Renames the mode, where new‑name conforms to conventions described in Identifiers. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.
SET SCHEMA schema

Moves the model from one schema to another.

Privileges

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

  • Model owner
  • ALTER privilege on the model

For certain operations, non-superusers must have the following schema privileges:

Schema privileges required… For these operations…
CREATE, USAGE Rename model

CREATE: destination schema
USAGE: current schema

Move model to another schema

Examples

See Altering Models.