> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-fix-nav-issues.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Managed Postgres migrations FAQ

> Frequently asked questions about migrating data to ClickHouse Managed Postgres.

export const PrivatePreviewBadge = () => {
  return <div className="privatePreviewBadge">
            <div className="privatePreviewIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M5.33301 6.66667V4.66667V4.66667C5.33301 3.194 6.52701 2 7.99967 2V2C9.47234 2 10.6663 3.194 10.6663 4.66667V4.66667V6.66667" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path d="M8.00033 9.33337V11.3334" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path fillRule="evenodd" clipRule="evenodd" d="M11.333 14H4.66634C3.92967 14 3.33301 13.4033 3.33301 12.6666V7.99996C3.33301 7.26329 3.92967 6.66663 4.66634 6.66663H11.333C12.0697 6.66663 12.6663 7.26329 12.6663 7.99996V12.6666C12.6663 13.4033 12.0697 14 11.333 14Z" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
        </div>
            {'Private preview in ClickHouse Cloud'}
        </div>;
};

Many questions about how Postgres replication works — including `TOAST` columns, replication slots, publications, schema changes, and data type mappings — are covered in the [ClickPipes for Postgres FAQ](/integrations/clickpipes/postgres/faq). The information there applies to Managed Postgres migrations as well.

<h3 id="invalid-enum-value">
  I'm seeing an "invalid input value for enum" error during replication
</h3>

This error occurs when the source Postgres has an enum value that doesn't exist on the target Managed Postgres. Logical replication doesn't automatically propagate `ALTER TYPE ... ADD VALUE` commands, so new enum values added on the source after the initial schema setup will cause inserts to fail on the target.

To fix this, add the missing value to the enum type on the target Postgres:

```sql theme={null}
ALTER TYPE your_enum_type ADD VALUE 'new_value';
```

Replace `your_enum_type` with the name of your enum type and `'new_value'` with the missing value from the error message.

<h3 id="unique-constraint-violation">
  I'm seeing a unique constraint violation error during replication
</h3>

Unique constraint violations can occur during logical replication when the replication order causes a conflict with an existing unique constraint on the target. This can occur in CDC workloads involving replaying operations that temporarily violate uniqueness before a subsequent update resolves it.

To unblock replication, drop the unique constraint on the target Postgres:

```sql theme={null}
ALTER TABLE your_table DROP CONSTRAINT your_constraint_name;
```

You can find the constraint name by running:

```sql theme={null}
SELECT conname, conrelid::regclass
FROM pg_constraint
WHERE contype = 'u';
```

Re-add the constraint during cutover, once replication is complete and the source is no longer active:

```sql theme={null}
ALTER TABLE your_table ADD CONSTRAINT your_constraint_name UNIQUE (column1, column2);
```
