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.

Namespace errors:

Error CodeError messageCause
ERRcurrent namespace is empty, blank or nullThe session has no current namespace. This does not happen under normal operation.

Return the default namespace:

> NAMESPACE CURRENT
global

Return the namespace after switching:

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