Note: this might apply to other databases, I only tested it with postgres

Installing drupal using an alternate schema on a database which does not contain the default "public" schema results in the following error after giving it the database information:

Failed to CREATE a test table on your PostgreSQL database server with the command CREATE TABLE drupal_install_test (id int NULL). PostgreSQL reports the following message: SQLSTATE[3F000]: Invalid schema name: 7 ERROR: no schema has been selected to create in.

Restoring the default public schema allows the install to run without this error.

Recommended practice when using schemas is to remove the default public schema, so this test really should run against the schema provided if the user gives one in the database advanced options rather than counting on the existence of the public one.

CommentFileSizeAuthor
#2 882934-schema-improvements.patch1.51 KBjosh waihi

Comments

damien tournoud’s picture

Version: 7.0-alpha6 » 7.x-dev

Yes, the drupal_install_test table is created directly, skipping all the rest of the database handler (including management of schemas). We should fix that.

josh waihi’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

Have altered drupal_install_test to use db_create_table. All seems fine. Haven't tested if is works without a public schema but I assume it will. NOTE: if you use a non-standard schema, you should specify it as a prefix like "myschema." ensuring the period at the end.

josh waihi’s picture

Title: Database tests during install incorrectly use public schema rather than the one provided » Database create table test should use Drupal schema
Component: postgresql database » database system

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.