Problem/Motivation
Currently we are working on making it possible to change the schema name for a PostgreSQL site installation in issue #1060476: Multiple issues when PostgreSQL is used with non-public schema. Once this feature is successfully made it would be necessary to add a option to change the schema name during or after installation.
Steps to reproduce
Install a clean site and/or try to change the schema name.
Proposed resolution
Add the option to change the schema name during the installation of a clean site in the advanced options tab.
Add the option to set the schema name in the settings.php file, in case the user wants to change this afterwards.
Create tests for the newly added option.
Remaining tasks
Write the patch with the test.
Review the patch.
Commit the patch.
User interface changes
Extra option during installation.
API changes
Data model changes
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | Screenshot 2025-04-25 at 11.28.52.png | 280.95 KB | vadim.jin |
| #11 | 3328215-11.patch | 4.04 KB | _utsavsharma |
| #11 | interdiff-5-11.txt | 683 bytes | _utsavsharma |
| #5 | 3328215-5.patch | 4.03 KB | arantxio |
Comments
Comment #2
arantxioCreated this issue as follow up on the related issue (#1060476), as proposed by @catch on Slack.
Comment #3
daffie commentedI am postponing this issue until #1060476: Multiple issues when PostgreSQL is used with non-public schema has landed.
Comment #4
arantxio#1060476: Multiple issues when PostgreSQL is used with non-public schema has landed.
Comment #5
arantxioI've just created the change record and here is a patch that seems to be working correctly and also tests if it works during installation.
Comment #6
daffie commentedAll code changes look good to me.
The option has been added to the installer.
Testing has been added.
The default.settings.php have been updated.
The CR and Is are in order.
For me it is RTBC.
Comment #8
arantxioThere was a issue with the test bot, but that seems to be resolved. Patch still applies and also tests are still succeeding. Back to RTBC.
Comment #10
longwaveI was confused about where this is actually used, and why we were adding this to the documentation here, but #1060476: Multiple issues when PostgreSQL is used with non-public schema added this feature without documenting it.
Title case is not appropriate here:
Is this necessary now we have per-driver tests? Why would the Postgres tests run at all if we are in a MySQL CI environment?
Comment #11
_utsavsharma commentedTried to address pointer 1.
Please review.
Comment #12
poker10 commentedThanks for working on this.
In addition to points from @longwave, there is at least one additional issue with the patch.
The new schema input field is not required. Therefore it could be left blank. In case you left that input blank, Drupal will not install, but throws an error:
When we compare it with the port input field, which is not required as well, Drupal will install in case you leave the port field empty. Therefore we need to either mark the schema field as required, or fix the additional handling of the value in case it is left empty (and use
publicinstead).I have not tested this further with empty schema in settings.php (whether the default
publicis used in this case as well), but will do it after the installation process will be working.Not sure about the "Needs backport to D7" tag - I think, that the D7 is not working 100% correctly on schema different from public (it was not fixed unlike the D10), so probably there is no point in addressing this in D7 unless the schema usage has been fixed.
Comment #13
vadim.jin commentedDoes someone faced with next issue during re-installation drupal using drush command?
So, I have Drupal 10 site core, PostGreSQL database and use non-public schema. I have applied patches from the corresponding article. And It gives me result - I can make clean install site when my schema doesnot have any tables. But if I trying to re-install site by run 'drush si' command I faced with an error "To start over you ust empty your existing database".
When drupal ask:
I choose yes and I got the error.

But if I do the same steps using 'public' schema I can successfully re-install the site and before installation all tables will be dropped.
Comment #14
daffie commented@vadim.jin: Support for Drupal on PostgreSQL in another schema then public is something that is at the moment not supported. Would be great if we can make it work. You could work on this this by creating a PR and I will review it.