Import schema fails on all Voyager installs done after August 14, 2025

15 Aug 2025
Product Affected Versions Related Issues Fixed In
YugabyteDB Voyager All TA-2968 Planned in v2025.8.2

Description

On August 14th, 2025, PostgreSQL released version 17.6, which included a critical security fix for 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).
  2. grep for files that have \restrict and \unrestrict commands.
  3. Delete all such lines from the schema files.
  4. 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:

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:

\restrict CacygjV1huJ5vGqw3mdrjx7e7bhlhGzfKcLxs37yfGQtH2EvLpT5atQZl6zOhBg

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

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