Problem/Motivation
Drupal works only on PostgreSQL when it is installed on the default schema called "public". Drupal should also work on other schemas.
Proposed resolution
Change the hardcoded schema name "public" to one set by the connection options from settings.php.
To test that it all works a number of tests need to be added. The drupal testbot has for PostgreSQL an extra schema called "testing_fake". This schema was added for this issue.
What operation the test should do:
- The test should start by creating a cloned database connection with the schema set to "testing_fake";
- Create a table in the new schema;
- Add, change, and delete a primary key;
- Add, change and delete a unique key;
- Add, change and delete a non unique key;
- Add, change and delete a column/field;
- Do a table search;
- Rename a table;
- Insert data in the table;
- Update the data in the table;
- Merge the data in the table;
- Upsert data in the table;
- Delete data from the table;
- Truncate the data in the table;
- Drop the table;
All operations should be tested that do what they should. For instance when you test renaming a table, test that there is no table with the old name and there is a table with the new name.
Remaining tasks
Write the patch with the test.
Review the patch.
Commit the patch.
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD
The original summary
I've tried to install Drupal 7 on 2 separate systems using a PostgreSQL 9.0 database backend, and both times it has failed at the same point.
The error message in the PostgreSQL logs both times is:
ERROR: null value in column "rid" violates not-null constraint
STATEMENT: INSERT INTO role_permission (rid, permission, module)
VALUES (NULL, 'administer blocks', 'block')
I followed the instructions in INSTALL.pgsql.txt, and everything else
installs up to this point.
The actual error message returned on the installation page is:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: http://bison:8089/install.php?profile=standard&locale=en&id=1&op=do
StatusText: OK
ResponseText:
Home | Drupal
@import url("http://bison:8089/modules/system/system.theme.css?0");
@import url("http://bison:8089/modules/system/system.messages.css?0");
@import url("http://bison:8089/modules/system/system.menus.css?0");
@import url("http://bison:8089/modules/system/system.base.css?0");
@import url("http://bison:8089/modules/comment/comment.css?0");
@import url("http://bison:8089/modules/field/theme/field.css?0");
@import url("http://bison:8089/modules/node/node.css?0");
@import url("http://bison:8089/modules/search/search.css?0");
@import url("http://bison:8089/modules/user/user.css?0");
@import url("http://bison:8089/modules/system/system.admin.css?0");
@import url("http://bison:8089/modules/system/system.maintenance.css?0");
@import url("http://bison:8089/themes/seven/reset.css?0");
@import url("http://bison:8089/themes/seven/style.css?0");
Home
Installation tasksChoose profile(done)Choose language(done)Verify
requirements(done)Set up database(done)Install
profile(active)Configure siteFinished
SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current
transaction is aborted, commands ignored until end of transaction
block
Steps to recreate:
Gentoo x64 (2.6.31 kernel)
Apache 2.2.15
PHP 5.2.14
PostgreSQL 9.0.3
1) Run: wget http://ftp.drupal.org/files/projects/drupal-7.0.tar.gz
2) Extract using: tar xvf drupal-7.0.tar.gz
3) Create destination directroy: mkdir /var/www/drupal-7.0
4) Copy files: mv drupal-7.0/* drupal-7.0/.htaccess /var/www/drupal-7.0
3) chgrp -R apache /var/www/drupal-7.0
4) Run: createuser --pwprompt --encrypted --no-createrole --no-createdb drupal
5) Run: createdb --encoding=UTF8 --owner=drupal drupal
6) Run: psql -U postgres -c "CREATE SCHEMA drupal AUTHORIZATION drupal;" drupal
7) Change to drupal dir: cd /var/www/drupal-7.0
8) Change permissions on default sites dir: chmod a+w sites/default
9) Create settings file: cp sites/default/default.settings.php sites/default/settings.php
10) Update settings permissions: chmod a+w sites/default/settings.php
11) Update sites/default/settings.php file as per INSTALL.pgsql.txt with schema name, by adding this line: $db_prefix = 'drupal';
12) Navigate to webpage and follow installation.
13) Error appears as described above.
Screenshots of installation attached.
Installation appears to work fine when using a schema named anything but "drupal", or not using a schema at all.