Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Platforms/PostgreSQL/PostgreSQLMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ public function getAllSequences(): iterable

private function buildNamespaceNamePredicate(string $columnName): string
{
return sprintf("%1\$s NOT LIKE 'pg\_%%' AND %1\$s != 'information_schema'", $columnName);
return sprintf("%1\$s NOT LIKE 'pg\$_%%' ESCAPE '\$' AND %1\$s != 'information_schema'", $columnName);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/PostgreSQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function getListSequencesSQL(string $database): string
increment AS increment_by
FROM information_schema.sequences
WHERE sequence_catalog = ' . $this->quoteStringLiteral($database) . "
AND sequence_schema NOT LIKE 'pg\_%'
AND sequence_schema NOT LIKE 'pg\$_%' ESCAPE '\$'
AND sequence_schema != 'information_schema'";
}

Expand Down
4 changes: 2 additions & 2 deletions src/Schema/PostgreSQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function listSchemaNames(): array
<<<'SQL'
SELECT schema_name
FROM information_schema.schemata
WHERE schema_name NOT LIKE 'pg\_%'
WHERE schema_name NOT LIKE 'pg$_%' ESCAPE '$'
AND schema_name != 'information_schema'
SQL,
);
Expand Down Expand Up @@ -338,7 +338,7 @@ protected function selectTableNames(string $databaseName): Result
table_schema AS schema_name
FROM information_schema.tables
WHERE table_catalog = ?
AND table_schema NOT LIKE 'pg\_%'
AND table_schema NOT LIKE 'pg$_%' ESCAPE '$'
AND table_schema != 'information_schema'
AND table_name != 'geometry_columns'
AND table_name != 'spatial_ref_sys'
Expand Down
2 changes: 1 addition & 1 deletion tests/Platforms/PostgreSQLPlatformTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public function testGetListSequencesSQL(): void
increment AS increment_by
FROM information_schema.sequences
WHERE sequence_catalog = 'test_db'
AND sequence_schema NOT LIKE 'pg\_%'
AND sequence_schema NOT LIKE 'pg\$_%' ESCAPE '\$'
AND sequence_schema != 'information_schema'",
$this->platform->getListSequencesSQL('test_db'),
);
Expand Down
Loading