daffie / drupal-core-pgsql-module-remover
Composer plugin that removes the pgsql module from Drupal core so a contrib/custom module named 'pgsql' can be used.
Package info
gitlab.com/daffie/drupal-core-pgsql-module-remover
Type:composer-plugin
pkg:composer/daffie/drupal-core-pgsql-module-remover
Requires
- php: >=8.3
- composer-plugin-api: ^2.0
Requires (Dev)
- composer/composer: ^2.3
- phpunit/phpunit: ^11.0
This package is not auto-updated.
Last update: 2026-07-03 10:37:17 UTC
README
A Composer plugin that removes the pgsql module from Drupal core after every
composer install / composer update.
Why
Drupal requires module machine names to be globally unique. Core ships a module
named pgsql (at web/core/modules/pgsql), which collides with any contrib or
custom module that also wants the pgsql name — Drupal's extension discovery
finds two pgsql.info.yml files and errors out.
This plugin deletes core's pgsql module directory so the name is free for the
replacement module. It works the same whether your project is built from
drupal/core, drupal/recommended-project, or drupal/cms, since all three
install the same drupal/core package.
Installation
A stable 1.0.1 release is tagged, so no minimum-stability changes are
needed — Composer resolves it out of the box:
composer require daffie/drupal-core-pgsql-module-remover:^1.0
Composer 2.2+ blocks plugins that aren't explicitly allowed. Add the plugin to
config.allow-plugins in your project's composer.json, otherwise it will
never run:
{
"config": {
"allow-plugins": {
"daffie/drupal-core-pgsql-module-remover": true
}
}
}
This entry is required for every version, including the tagged stable release — it is gated the same as any other plugin. Without it:
composer installfails with aPluginManagererror (contains a Composer plugin which is blocked by your allow-plugins config).- On
composer requirethe package is still added, but the plugin is silently skipped, soweb/core/modules/pgsqlis not removed.
You can also add the entry from the command line:
composer config allow-plugins.daffie/drupal-core-pgsql-module-remover true
How it works
The plugin subscribes to Composer's post-install-cmd and post-update-cmd
events. On each run it locates the installed drupal/core package, resolves its
install path, and deletes <core>/modules/pgsql if present. The operation is
idempotent — if the directory is already gone, it does nothing.
⚠️ Warning: this also removes the PostgreSQL database driver
Core's pgsql module contains the PostgreSQL database driver
(core/modules/pgsql/src/Driver/Database/pgsql). Deleting the module removes
that driver. Only use this plugin if:
- your replacement
pgsqlmodule provides its own PostgreSQL driver, or - the site does not use PostgreSQL.
License
GPL-2.0-or-later