---
title: untier_chunk() | Tiger Data Docs
description: Move a tiered chunk from object storage back to local storage
---

Move a previously tiered chunk from object storage back to local Tiger Cloud storage. After the call returns, the chunk behaves like any other local chunk and is no longer billed against object storage.

If the chunk is still in the tiering queue and has not yet been uploaded to object storage, `untier_chunk` simply unfreezes it and removes it from the queue without any data copy.

Otherwise, the chunk's contents are copied from object storage into a temporary table named `osm_tmp<chunk_name>` in the chunk's original schema. The copied row count is compared against the count recorded in the catalog; if they differ the procedure aborts and the temporary table is left in place for inspection.

Once the copy is verified, the chunk is re-attached to its hypertable and the tiered copy is removed from the object store catalog.

`untier_chunk` is a `PROCEDURE` and must be invoked with `CALL`.

Note

If a check constraint defined on the parent hypertable is violated by rows in the tiered chunk, `untier_chunk` raises an exception. The temporary `osm_tmp<chunk_name>` table is preserved so you can fix the offending rows and re-run `untier_chunk` to resume.

## Samples

- **Move a tiered chunk back into local storage**:

  ```
  CALL untier_chunk('_hyper_1_1_chunk');
  ```

## Arguments

The syntax is:

```
CALL untier_chunk(
    osm_chunk_name = '<chunk_name>'
);
```

| Name             | Type   | Default | Required | Description                                                                                                                    |
| ---------------- | ------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `osm_chunk_name` | `TEXT` | -       | ✔        | Name of the tiered chunk, as recorded in the object storage catalog. This is the chunk's table name without the schema prefix. |

## Returns

This procedure returns no value.

## Errors

`untier_chunk` raises an exception when:

- The supplied chunk name does not exist in the object storage catalog.
- The number of rows copied from object storage does not match the row count recorded in the catalog.
- A check constraint on the parent hypertable is violated by rows in the chunk.
- The chunk could not be unfrozen.
