---
title: convert_to_rowstore() | Tiger Data Docs
description: Move a chunk from the columnstore to the rowstore
---

Since [2.18.0](https://github.com/timescale/timescaledb/releases/tag/2.18.0)

`convert_to_rowstore()` replaces `decompress_chunk()`, deprecated in 2.18.0.

Manually convert a specific chunk in the hypertable columnstore to the rowstore.

If you need to modify or add a lot of data to a chunk in the columnstore, best practice is to stop any [jobs](/docs/reference/timescaledb/jobs-automation/index.md) moving chunks to the columnstore, convert the chunk back to the rowstore, then modify the data. After the update, [convert the chunk to the columnstore](/docs/reference/timescaledb/hypercore/convert_to_columnstore/index.md) and restart the jobs. This workflow is especially useful if you need to backfill old data.

## Samples

To modify or add a lot of data to a chunk:

1. **Stop the jobs that are automatically adding chunks to the columnstore**

   Retrieve the list of jobs from the [timescaledb\_information.jobs](/docs/reference/timescaledb/informational-views/jobs/index.md) view to find the job you need to [alter\_job](/docs/reference/timescaledb/jobs-automation/alter_job/index.md).

   ```
   SELECT alter_job(JOB_ID, scheduled => false);
   ```

2. **Convert a chunk to update back to the rowstore**

   ```
   CALL convert_to_rowstore('_timescaledb_internal._hyper_2_2_chunk');
   ```

3. **Update the data in the chunk you added to the rowstore**

   Best practice is to structure your [INSERT](/docs/build/data-management/write-data/insert/index.md) statement to include appropriate partition key values, such as the timestamp. TimescaleDB adds the data to the correct chunk:

   ```
   INSERT INTO metrics (time, value)
   VALUES ('2025-01-01T00:00:00', 42);
   ```

4. **Convert the updated chunks back to the columnstore**

   ```
   CALL convert_to_columnstore('_timescaledb_internal._hyper_1_2_chunk');
   ```

5. **Restart the jobs that are automatically converting chunks to the columnstore**

   ```
   SELECT alter_job(JOB_ID, scheduled => true);
   ```

## Arguments

The syntax is:

```
CALL convert_to_rowstore(
    chunk = '<chunk_name>',
    if_columnstore = true | false
);
```

| Name             | Type     | Default | Required | Description                                                                                                |
| ---------------- | -------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| `chunk`          | REGCLASS | -       | ✔        | Name of the chunk to be moved to the rowstore.                                                             |
| `if_columnstore` | BOOLEAN  | `true`  | ✖        | Set to `false` so this call fails with an error rather than a warning if `chunk` is not in the columnstore |

## Returns

This function returns void.
