> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_InteriorRingN

Returns the Nth interior linestring ring of the polygon geometry. Returns NULL if the geometry is not a polygon or the given N is out of range

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_InteriorRingN/ST_InteriorRingN.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=d2669160d0e9d055968ecb7e3e1b2499" alt="ST_InteriorRingN" width="500" height="300" data-path="images/sql-functions/ST_InteriorRingN/ST_InteriorRingN.svg" />

## Signatures

```sql theme={"system"}
ST_InteriorRingN(geom: Geometry, n: Integer)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="n" type="Integer" required>
  The index or count value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_InteriorRingN(ST_GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0), (1 1, 2 1, 2 2, 1 2, 1 1), (1 3, 2 3, 2 4, 1 4, 1 3), (3 3, 4 3, 4 4, 3 4, 3 3))'), 0)
```

```
LINESTRING (1 1, 2 1, 2 2, 1 2, 1 1)
```
