Skip to content

Release 3.2.1 regression: [PDOException] SQLSTATE[42P01]: Undefined table #84

@lnedialkov

Description

@lnedialkov

Problem

Release 3.2.1 seems to introduce a regression in the following use case:

$I->haveInDatabase('schema.table', [
    'id' => 999,
    'id_one' => $id1,
    'id_two' => $id2
]);

The error is the following: [PDOException] SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "schema.table" does not exist
The PostgreSql#getPrimaryKey query is:

SELECT a.attname
FROM   pg_index i
JOIN   pg_attribute a ON a.attrelid = i.indrelid
                     AND a.attnum = ANY(i.indkey)
WHERE  i.indrelid = '"schema.table"'::regclass
AND    i.indisprimary

Solution

Removing the quotes that were introduced in #82 fixes the problem.
Perhaps there is another way to support upper case table names?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions