> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference.md).

# SQL Reference

The CARTO Analytics Toolbox's functions are organized in modules based on the functionality they offer. On this page you will find the full list with direct links to their definition.

| Module  | Function or Procedure                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| h3      | <p><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_boundary">H3\_BOUNDARY</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_center">H3\_CENTER</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_compact">H3\_COMPACT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_distance">H3\_DISTANCE</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_fromgeogpoint">H3\_FROMGEOGPOINT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_fromlonglat">H3\_FROMLONGLAT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_hexring">H3\_HEXRING</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_int_tostring">H3\_INT\_TOSTRING</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_ispentagon">H3\_ISPENTAGON</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_isvalid">H3\_ISVALID</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_kring">H3\_KRING</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_kring_distances">H3\_KRING\_DISTANCES</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_polyfill">H3\_POLYFILL</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_polyfill_table">H3\_POLYFILL\_TABLE</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_string_toint">H3\_STRING\_TOINT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_tochildren">H3\_TOCHILDREN</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_toparent">H3\_TOPARENT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/h3.md#h3_uncompact">H3\_UNCOMPACT</a></p>                                                                                                                                                                                                                                                                                                                                                                                      |
| quadbin | <p><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_bbox">QUADBIN\_BBOX</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_boundary">QUADBIN\_BOUNDARY</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_center">QUADBIN\_CENTER</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_distance">QUADBIN\_DISTANCE</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_fromgeogpoint">QUADBIN\_FROMGEOGPOINT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_fromlonglat">QUADBIN\_FROMLONGLAT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_fromquadkey">QUADBIN\_FROMQUADKEY</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_fromzxy">QUADBIN\_FROMZXY</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_isvalid">QUADBIN\_ISVALID</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_kring">QUADBIN\_KRING</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_kring_distances">QUADBIN\_KRING\_DISTANCES</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_polyfill">QUADBIN\_POLYFILL</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_polyfill_table">QUADBIN\_POLYFILL\_TABLE</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_resolution">QUADBIN\_RESOLUTION</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_sibling">QUADBIN\_SIBLING</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_tochildren">QUADBIN\_TOCHILDREN</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_toparent">QUADBIN\_TOPARENT</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_toquadkey">QUADBIN\_TOQUADKEY</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/quadbin.md#quadbin_tozxy">QUADBIN\_TOZXY</a></p> |
| tiler   | <p><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/tiler.md#create_simple_tileset">CREATE\_SIMPLE\_TILESET</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/tiler.md#create_point_aggregation_tileset">CREATE\_POINT\_AGGREGATION\_TILESET</a><br><a href="/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference/tiler.md#create_spatial_index_tileset">CREATE\_SPATIAL\_INDEX\_TILESET</a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.carto.com/data-and-analysis/analytics-toolbox-for-postgresql/sql-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
