I am using Drupal 8.0.2. I tried to install Drupal on non public schema on PostgreSql but it fails.
First it wanted me to alter table with this command :
ALTER DATABASE "mydb" SET bytea_output = 'escape'
After that I tried to continue but gives me this:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bytea LINE 1: ...pe', '-1', '1452505119.152', 'entity_types', '0', 'a:6:{s:19... ^: INSERT INTO myschema.cache_discovery (cid, expire, created, tags, checksum, data, serialized) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( ) in Drupal\Core\Plugin\DefaultPluginManager->cacheSet() (line 76 of /var/www/html/drupal/wwwroot/core/lib/Drupal/Core/Cache/UseCacheBackendTrait.php).
Drupal\Core\Plugin\DefaultPluginManager->cacheSet('entity_type', Array, -1, Array)
Drupal\Core\Plugin\DefaultPluginManager->setCachedDefinitions(Array)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
Drupal\Core\Entity\EntityManager->getDefinitions()
Drupal\Core\Config\ConfigManager->getEntityTypeIdByName('core.extension')
Drupal\Core\Config\ConfigInstaller->createConfiguration('', Array)
Drupal\Core\Config\ConfigInstaller->installDefaultConfig('core', 'core')
Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig('core', 'core')
drupal_install_system(Array)
install_base_system(Array)
install_run_task(Array, Array)
install_run_tasks(Array)
install_drupal(Object)
Comments
Hi, BORANBURCIN,
Hi, BORANBURCIN,
this is because the public schema is hardcoded in some places in the code. For example:
Then Drupal decide how to insert data depending on the column type. Column type is wrong, because table cache_data doesn't exists in schema public.
There are other mistakes in the Drupal code. How Drupal checks if table exists?
SELECT 1 FROM pg_class WHERE relname = 'cache_data'It's nonsense, of course. Table cache_data can exist thousands of times in one database in different schemas. Drupal tries to create the table, but cannot, because it exists. Correct query is
select 1 from pg_tables where tablename = 'sometable' and schemaname = 'someschema'