Skip to content

Commit 0b00f21

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

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
--health-timeout 5s
4242
--health-retries 5
4343
postgres:
44-
image: postgres
44+
image: postgres:16.4
4545
env:
4646
POSTGRES_PASSWORD: postgres
4747
POSTGRES_DB: codeception_test

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"codeception/codeception": "*@dev"
2323
},
2424
"require-dev": {
25+
"behat/gherkin": "~4.10.0",
2526
"squizlabs/php_codesniffer": "*"
2627
},
2728
"conflict": {

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
- "3306:3306"
3131

3232
postgres:
33-
image: postgres
33+
image: postgres:16.4
3434
environment:
3535
POSTGRES_PASSWORD: codeception
3636
POSTGRES_DB: codeception

src/Codeception/Lib/Driver/PostgreSql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function getPrimaryKey(string $tableName): array
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
167+
WHERE i.indrelid = '" . $this->getQuotedName($tableName) . "'::regclass
168168
AND i.indisprimary";
169169
$stmt = $this->executeQuery($query, []);
170170
$columns = $stmt->fetchAll(PDO::FETCH_ASSOC);

0 commit comments

Comments
 (0)