We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a295c4 commit 18263f3Copy full SHA for 18263f3
src/Codeception/Lib/Driver/PostgreSql.php
@@ -160,12 +160,12 @@ public function getPrimaryKey(string $tableName): array
160
{
161
if (!isset($this->primaryKeys[$tableName])) {
162
$primaryKey = [];
163
- $query = "SELECT a.attname
+ $query = 'SELECT a.attname
164
FROM pg_index i
165
JOIN pg_attribute a ON a.attrelid = i.indrelid
166
AND a.attnum = ANY(i.indkey)
167
- WHERE i.indrelid = '\"{$tableName}\"'::regclass
168
- AND i.indisprimary";
+ WHERE i.indrelid = ' . $this->getQuotedName($tableName) . '::regclass
+ AND i.indisprimary';
169
$stmt = $this->executeQuery($query, []);
170
$columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
171
foreach ($columns as $column) {
0 commit comments