PostgreSQL Installation Error

Created on 2 October 2023, about 1 year ago
Updated 25 March 2024, 8 months ago

Hello all,

Problem/Motivation

When I try to install autoslave on my Drupal 9.5.11, PHP 8.1.23, PostgreSQL 15.4 site, I get WSOD with the error message below:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "NOT" LINE 7: "ts" NOT NULL, ^: CREATE TABLE "autoslave_server_stats" ( "id" serial, "server_num" int NOT NULL, "n_select" int NULL, "n_insert" int NULL, "n_update" int NULL, "ts" NOT NULL, CONSTRAINT autoslave_server_stats____pkey PRIMARY KEY ("id") ); Array ( ) in Drupal\Core\Extension\ModuleInstaller->installSchema() (line 648 of core/lib/Drupal/Core/Extension/ModuleInstaller.php).

When I go back to /admin/modules, I see the error message below, as a system message:

Error message
Warning: Undefined array key "datetime:normal" in Drupal\pgsql\Driver\Database\pgsql\Schema->processField() (line 392 of core/modules/pgsql/src/Driver/Database/pgsql/Schema.php).  

Steps to reproduce

- Install Drupal (with PostgreSQL)
- Try to install autoslave 8.x-3.x-dev

What could be done, in order to solve this bug?

Best,
Orkut

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇹🇷Turkey orkut murat yılmaz Istanbul

Live updates comments and jobs are added and updated live.
  • PostgreSQL

    Particularly affects sites running on the PostgreSQL database.

Sign in to follow issues

Comments & Activities

  • Issue created by @orkut murat yılmaz
  • 🇺🇦Ukraine vadim.jin

    As I understand the issue in autoslave.install file. There is 'ts' field (looks like short from timestump), the field type is 'datetime'. For PostgreSQL it's not fully correct. I had change it to 'int' type, set 'not null' => true and 'default' => 0.
    Notice, install file has two such fields in schema function, both have to change. After that installation runs over.

  • 🇺🇸United States mmrtnt

    Can confirm. Making these changes allowed the module to install successfully.

Production build 0.71.5 2024