Skip to content

Ability to define a multi-schema search_path for PostgreSQL lost after changes in #8394 #8639

Closed
@dcro

Description

@dcro

Up until the changes from #8394 were made, it was possible to define a multi-schema search path when defining a database configuration (in database.php):

'connections' => [
    'db1' => [
        'driver'   => 'pgsql',
        /* ... */
        'schema'   => 'schema1,schema2,schema3',
    ]
],

This translated in the following query that was executed immediately after the connection was established:

SET search_path TO schema1,schema2,schema3;

After the changes in #8394, this now translates to the following SQL query:

SET search_path TO "schema1,schema2,schema3";

which basically breaks the previous functionality.

Is it possible to get multi-schema support back?

A couple of potential solutions that I see:

  • leave the current functionality unchanged, but allow the database config to include a list of SQL commands that would be executed immediately after the connection is established.
  • allow a comma separated list of schemas (or possibly an array of schema names) and escape each schema name individually for connection adapters that do support multiple schemas.

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