Skip to content

Commit 18263f3

Browse files
committed
fix: properly quote table names with schema definition (#84)
1 parent 8a295c4 commit 18263f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Codeception/Lib/Driver/PostgreSql.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ public function getPrimaryKey(string $tableName): array
160160
{
161161
if (!isset($this->primaryKeys[$tableName])) {
162162
$primaryKey = [];
163-
$query = "SELECT a.attname
163+
$query = 'SELECT a.attname
164164
FROM pg_index i
165165
JOIN pg_attribute a ON a.attrelid = i.indrelid
166166
AND a.attnum = ANY(i.indkey)
167-
WHERE i.indrelid = '\"{$tableName}\"'::regclass
168-
AND i.indisprimary";
167+
WHERE i.indrelid = ' . $this->getQuotedName($tableName) . '::regclass
168+
AND i.indisprimary';
169169
$stmt = $this->executeQuery($query, []);
170170
$columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
171171
foreach ($columns as $column) {

0 commit comments

Comments
 (0)