# JOIN POLICY

Config path: `/<database>/<schema>/join_policy/<name>.yaml`

Example:

```yaml
body: |-
  CASE
    WHEN IS_ROLE_IN_SESSION('SYSADMIN')
    THEN JOIN_CONSTRAINT(JOIN_REQUIRED => FALSE)
    ELSE JOIN_CONSTRAINT(JOIN_REQUIRED => TRUE)
  END

```

## Schema

* <mark style="background-color:red;">**body**</mark> (str) - policy SQL expression
* **comment** (str)&#x20;

## Usage notes

1. Management of join policies requires active warehouse due to unavoidable [POLICY\_REFERENCES](https://docs.snowflake.com/en/sql-reference/functions/policy_references.html) table function calls.
2. Row access policies always return `JOIN_CONSTRAINT`.

## Links

* [CREATE JOIN POLICY](https://docs.snowflake.com/en/sql-reference/sql/create-join-policy)
* [SHOW JOIN POLICIES](https://docs.snowflake.com/en/sql-reference/sql/show-join-policies)
* [DESC JOIN POLICY](https://docs.snowflake.com/en/sql-reference/sql/desc-join-policy)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/join_policy.py)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snowddl.com/basic/yaml-configs/join-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
