Skip to content

DBAL-453: PostgreSqlSchemaManager::getSchemaSearchPaths does not work for secondary schemas #1651

Closed
doctrinebot opened this Issue Feb 24, 2013 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user rhunwicks:

PostgreSqlSchemaManager::getSchemaSearchPaths() uses "SHOW searchpath" to get the current search path for the connection and explodes it using a comma delimiter. On my installation Postgresql 9.1 on Ubuntu 12.04 "SHOW search_path" returns the schemas in the search path separated by ", " (i.e. a comma followed by a space). This means that the array of schemas returned by getSchemaSearchPaths() will including a leading space on the schema names for the second and subsequent schemas in the search list.

This is a particular problem if you call PostgreSqlSchemaManager::getExistingSchemaSearchPaths() because that calls determineExistingSchemaSearchPaths() which filters the list from getSchemaSearchPaths() to make sure they are in the list of schemas in the database (as returned from getSchemaNames(). The second and subsequent schemas in the search path still have a leading space when they are compared to the array of schema names, and consequently they do not match and are not included in the array returned by getExistingSchemaSearchPaths().

I think that getSchemaSearchPaths should trim the leading space from the schemas.

@doctrinebot

Comment created by @beberlei:

Fixed in 2.3.4

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.3.4 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.