yb_server_zone() returns the zone that a user's server is connected to.
Select the zone that you're connected to:
yugabyte=# SELECT yb_server_zone();
yb_server_zone ----------------- us-west-1c (1 row)
Usage in Row-level geo-partitioning
yb_server_region(), this function is also helpful while implementing Row-level geo-partitioning, as it can significantly simplify inserting rows from the user server's partition if the partitioning is based on default value of yb_server_zone().
NoteIf you didn't set the placement_region flag at node startup, yb_server_region() returns NULL.