NAMESPACE CURRENT
Returns the active namespace for the current session.
Syntax
Section titled “Syntax”NAMESPACE CURRENTParameters
Section titled “Parameters”None.
Return Value
Section titled “Return Value”Bulk string: the dot-separated namespace path currently active in the session.
Behavior
Section titled “Behavior”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.
Errors
Section titled “Errors”Namespace errors:
| Error Code | Error message | Cause |
|---|---|---|
ERR | current namespace is empty, blank or null | The session has no current namespace. This does not happen under normal operation. |
Examples
Section titled “Examples”Return the default namespace:
> NAMESPACE CURRENTglobalReturn the namespace after switching:
> NAMESPACE USE production.usersOK
> NAMESPACE CURRENTproduction.users