Skip to content

NAMESPACE CURRENT

Returns the active namespace for the current session.

NAMESPACE CURRENT

None.

Bulk string: the dot-separated namespace path currently active in the session.

Every new session starts with the default namespace configured via default_namespace in the cluster configuration. The active namespace can be changed with NAMESPACE USE.

NAMESPACE CURRENT reads the active namespace from the session attributes and returns it as a bulk string.

Error CodeDescription
ERRThe current namespace is null, empty, or blank. This should not occur under normal operation since sessions are initialized with the default namespace.

Return the default namespace:

> NAMESPACE CURRENT
global

Return the namespace after switching:

> NAMESPACE USE production.users
OK
> NAMESPACE CURRENT
production.users