You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error is the following: [PDOException] SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "schema.table" does not exist
The PostgreSql#getPrimaryKey query is:
SELECTa.attnameFROM pg_index i
JOIN pg_attribute a ONa.attrelid=i.indrelidANDa.attnum= ANY(i.indkey)
WHEREi.indrelid='"schema.table"'::regclass
ANDi.indisprimary
Solution
Removing the quotes that were introduced in #82 fixes the problem.
Perhaps there is another way to support upper case table names?
In my initial commit quotes were only added when upper case names were detected, but this solution was discarded as seemed not necessary. Adding function again should fix it: a64585c
I have found out that the getQuotedName method already exists, so I replaced the custom-made escaping with it. It also properly supports schema definitions. Feedback is welcome. Sorry for the interruption.
Activity
jandrusku commentedon Feb 21, 2025
In my initial commit quotes were only added when upper case names were detected, but this solution was discarded as seemed not necessary. Adding function again should fix it: a64585c
lnedialkov commentedon Feb 24, 2025
Not really, at least not for $tableName var containing the schema name as well. These two lines should provide a fix for all scenarios:
fix: properly quote table names with schema definition (Codeception#84)
fix: properly quote table names with schema definition (Codeception#84)
fix: properly quote table names with schema definition (Codeception#84)
fix: properly quote table names with schema definition (Codeception#84)
fix: properly quote table names with schema definition #84 (#86)
szhajdu commentedon Mar 3, 2025
I have found out that the getQuotedName method already exists, so I replaced the custom-made escaping with it. It also properly supports schema definitions. Feedback is welcome. Sorry for the interruption.