Skip to content

Could not retrieve columns for a table with quotes on PostgreSQL#601

Closed
PowerKiKi wants to merge 1 commit intodoctrine:masterfrom
PowerKiKi:bug-could-not-retrieve-columns-from-db
Closed

Could not retrieve columns for a table with quotes on PostgreSQL#601
PowerKiKi wants to merge 1 commit intodoctrine:masterfrom
PowerKiKi:bug-could-not-retrieve-columns-from-db

Conversation

@PowerKiKi
Copy link
Contributor

If a table "user" exists in database, then it was not possible to retrieve
existing columns from that database, because we used to compare unquoted
table name with quoted table name. This lead to schema that were out of sync
and could never be validated.

If a table "user" exists in database, then it was not possible to retrieve
existing columns from that database, because we used to compare unquoted
table name with quoted table name. This lead to schema that were out of sync
and could never be validated.
@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-901

We use Jira to track the state of pull requests and the versions they got
included in.

@deeky666
Copy link
Member

deeky666 commented May 8, 2014

This is a duplicate of #572. Also I don't think your approach is working for all cases because quote_ident() only quotes the identifier if necessary and otherwise leaves it unquoted (database level) but the table name to be compared against can also be quoted expclicitly by the user even if not necessary (application level).
So IMO the other approach is a little better because there we always compare unquoted table names which should work in all cases. What do you think?

@PowerKiKi
Copy link
Contributor Author

Indeed it is the same issue with a different solution.

Also I didn't consider the use-case you describe, nor was I aware of Doctrine\DBAL\Schema\Identifier. So I would say that your solution is definitely better.

A shame I didn't look for your PR before working on mine. Thanks for the notice anyway !

@deeky666
Copy link
Member

deeky666 commented May 8, 2014

Nevermind :)

@PowerKiKi PowerKiKi deleted the bug-could-not-retrieve-columns-from-db branch May 9, 2014 06:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants