Skip to main content
The SHOW LOCALITY returns the of the current node. If locality was not specified on node startup, the statement returns an empty row.

Required privileges

No are required to list the locality of the current node.

Synopsis

show_locality syntax diagram

Example

Setup

The following example uses MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see . To follow along, run with the --nodes and --demo-locality tags. This command opens an interactive SQL shell to a temporary, multi-node in-memory cluster with the movr database preloaded and set as the .

Show locality

Show locality with a built-in function

If you know the locality key, you can use the built-in function to return the locality value for the current node:
For a more extensive example, see .

See also