The ALTER NAMESPACE
statement is used to modify an existing namespace. It can be used to rename a namespace or change its owner. It is not possible to change the type of the namespace.
In Polypheny, you can also use the SQL-typical ALTER SCHEMA
term, which serves as an alias to ALTER NAMESPACE
, hence offering identical functionality.
Syntax
The syntax for the ALTER NAMESPACE
statement to rename a namespace is:
ALTER NAMESPACE current_namespace_name RENAME TO new_namespace_name;
And the syntax to change the owner of a namespace is:
ALTER NAMESPACE namespace_name OWNER TO new_owner;
In both syntaxes, current_namespace_name
and namespace_name
refer to the name of the existing namespace that you wish to alter. The new_namespace_name
is the new name you want to assign to the namespace, and new_owner
is the name of the new owner.
Please note:
- You need the necessary privileges to alter a namespace.
- Ensure the new name or owner does not conflict with existing namespaces or owners.
Example
To rename a namespace:
ALTER NAMESPACE sales RENAME TO new_sales;
This ALTER NAMESPACE
statement renames the namespace from ‘sales’ to ‘new_sales’.
To change the owner of a namespace:
ALTER NAMESPACE sales OWNER TO pa;
This ALTER NAMESPACE
statement changes the owner of the ‘sales’ namespace to ‘pa’.