
| Product | Affected Versions | Related Issues | Fixed In |
| :------------------------- | :-------------------- | :---------------- | :------- |
| {{<product "voyager">}} | [v1.1](/stable/yugabyte-voyager/release-notes/#v1-1-march-7-2023) - [v2025.8.1](/stable/yugabyte-voyager/release-notes/#v2025-8-1-august-5-2025) | {{< ta 2968 >}} | [v2025.8.2](/stable/yugabyte-voyager/release-notes/#v2025-8-2-august-19-2025) |

## Description

On August 14th, 2025, PostgreSQL released version 17.6, which included a critical security fix for [CVE-2025-8714](https://www.postgresql.org/support/security/CVE-2025-8714/). This fix introduced a new "restricted" mode in `psql` to address vulnerabilities during `pg_dump` and `pg_restore` operations. The mode blocks all meta-commands, and both `pg_dump` and `pg_restore` now insert new `\restrict` and `\unrestrict` commands in plain-text dumps.

Any new Voyager installations performed after August 14, 2025, will automatically download and use this latest PostgreSQL 17.6 binary. As a result, schema files generated by the `export schema` command (which internally uses pg_dump) contain the `\restrict` and `\unrestrict` commands. When Voyager attempts to import such schema files, it fails to parse the `\restrict` and `\unrestrict` commands and errors out in the `import schema` phase, halting migrations. As a result, all installations done after August 14, 2025 are impacted.

## Mitigation

YugabyteDB Voyager v2025.8.2, which includes the fix, is tentatively scheduled for release in the week of August 18, 2025. Until then, you can manually correct the schema files using the following steps:

1. After running `export schema`, navigate to the migration folder (`export-dir` path).
1. `grep` for files that have `\restrict` and `\unrestrict` commands.
1. Delete all such lines from the schema files.
1. Proceed with the `import schema` and migration process using Voyager.

**Note**: If you run the `analyze-schema` phase of Voyager, it will also report `\restrict` and `\unrestrict` commands as unsupported.

## Details

An example error seen while importing the schema is as follows:

```output
failed to import schema for various objects: error checking whether to skip DDL for statement [\unrestrict CacygjV1huJ5vGqw3mdrjx7e7bhlhGzfKcLxs37yfGQtH2EvLpT5atQZl6zOhBg ]: error checking whether stmt is to add not valid constraint: error parsing the ddl[\UNRESTRICT CACYGJV1HUJ5VGQW3MDRJX7E7BHLHGZFKCLXS37YFGQTH2EVLPT5ATQZL6ZOHBG ]: syntax error at or near "\"
```

Example `\restrict` command found in the schema file `<migration_folder>/schema/tables/table.sql` is as follows:

```output
\restrict CacygjV1huJ5vGqw3mdrjx7e7bhlhGzfKcLxs37yfGQtH2EvLpT5atQZl6zOhBg
```

Example `\unrestrict` command found in the schema file `<migration_folder>/schema/tables/table.sql` is as follows:

```output
ALTER TABLE ONLY public.x
    ADD CONSTRAINT x_pkey PRIMARY KEY (id);
\unrestrict CacygjV1huJ5vGqw3mdrjx7e7bhlhGzfKcLxs37yfGQtH2EvLpT5atQZl6zOhBg
```

## Related articles

- [CVE-2025-8714](https://www.postgresql.org/support/security/CVE-2025-8714/)
- [Fix commit for CVE-2025-8714](https://github.com/postgres/postgres/commit/575f54d4cee8b141a91b3e5c3d7d65372c0f5219)
- [Manually editing the schema](/stable/yugabyte-voyager/migrate/migrate-steps/#manually-edit-the-schema)
