PostgreSQL should use the simpletest prefix as schema

Created on 19 June 2016, about 9 years ago
Updated 30 July 2025, 7 days ago

Problem/Motivation

#2751537: Race condition in \Drupal\Core\Database\Driver\pgsql\Install\Tasks breaks the testbot β†’ shows one problem of dumping objects in the public schema. We worked around it. But it's not perfect.

Proposed resolution

  1. On install time create a schema per prefix, catching exceptions to avoid creating the same schema twice.
  2. Change the functions to be installed into the default prefix schema.
  3. On connection time set search_path to the default prefix schema.
  4. As a followup move the Database::getConnection()->schema()->findTables('%') functionality in various test classes into a backoverridable service and override it for SQLite to drop the whole database and for PostgreSQL to drop the schema. Kill 'em all in one quick move. Bonus: no more function pollution.

Remaining tasks

Everything.

User interface changes

Nothing.

API changes

Nothing.

Data model changes

Schemas are in for prefixes. Because of BC, this probably needs to be restricted to test only. Oh well.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

postgresql db driver

Created by

πŸ‡¨πŸ‡¦Canada chx

Live updates comments and jobs are added and updated live.
  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024