Submodule AdvAgg Critical CSS is not working with PostgreSQL

Created on 22 September 2021, almost 3 years ago
Updated 30 October 2023, 8 months ago

Problem/Motivation

AdvAgg Critical CSS generates an pgsql error when enabling the module because one its columns is named after a reserved name : user

https://www.postgresql.org/docs/current/sql-keywords-appendix.html
from : https://stackoverflow.com/questions/10891368/postgres-table-column-name-...

Additionally, Postgres reserves system column names for internal use in every table: "Every table has several system columns that are implicitly defined by the system. Therefore, these names cannot be used as names of user-defined columns."

Steps to reproduce

Enable the sub-module (drupal install running with a pgsql database) : AdvAgg Critical CSS, this will produce the error :

PDOException : SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "user" LINE 4: user varchar(255) default '', ^: CREATE TABLE {advagg_critical_css} ( theme varchar(255) default '', type int NOT NULL default 0, user varchar(255) default '', lookup varchar(255) default '', css bytea, dns bytea, pre bytea, settings bytea, PRIMARY KEY (lookup, user, type, theme) ); Array ( ) dans db_create_table() (ligne 2803 dans /var/www/drupalvm/includes/database/database.inc).

Proposed resolution

Install schema has to be updated in order to be pgsql compatible and sql queries have also to be updated OR adding double quote in advagg_critical_css.install on 'user'.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France Jibus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024