---
title: error() | Tiger Data Docs
description: Get the maximum relative error for a `uddsketch`
---

Since [1.0.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/1.0.0)

Get the maximum relative error of a `uddsketch`. The correct (non-estimated) percentile falls within the range defined by `approx_percentile(sketch) +/- (approx_percentile(sketch) * error(sketch))`.

## Samples

Calculate the maximum relative error when estimating percentiles using `uddsketch`.

```
SELECT error(uddsketch(data))
FROM generate_series(0, 100) data;
```

```
error
-------
0.001
```

## Arguments

The syntax is:

```
error(
  sketch UddSketch
) RETURNS DOUBLE PRECISION
```

| Name   | Type      | Default | Required | Description                               |
| ------ | --------- | ------- | -------- | ----------------------------------------- |
| sketch | UddSketch | -       | ✔        | The `uddsketch` to determine the error of |

## Returns

| Column | Type             | Description                                            |
| ------ | ---------------- | ------------------------------------------------------ |
| error  | DOUBLE PRECISION | The maximum relative error of any percentile estimate. |
