Skip to content

Commit 5697865

Browse files
authored
Fixing issue with postgres tests. (#16751)
1 parent b870ff3 commit 5697865

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/server/src/api/routes/tests/datasource.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ if (datasources.length) {
647647
// pg_dump 17 puts this config parameter into the dump but no DB < 17
648648
// can load it. We're using postgres 16 in tests at the time of writing.
649649
schema = schema.replace("SET transaction_timeout = 0;", "")
650+
// Remove \restrict and \unrestrict commands that are not valid in older PostgreSQL versions
651+
schema = schema.replace(/\\restrict\s+[^\n]+\n?/g, "")
652+
schema = schema.replace(/\\unrestrict\s+[^\n]+\n?/g, "")
650653
}
651654
if (isPostgres && isLegacy) {
652655
// in older versions of Postgres, this is not a valid option - Postgres 9.5 does not support this.

0 commit comments

Comments
 (0)