Do not install dbxschema_get_table_ddl and dbxschema_clone_schema.

Created on 12 January 2023, almost 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

The PostgreSQL functions dbxschema_get_table_ddl and dbxschema_clone_schema are used in some cases to simplify things. But those functions need to be installed on the PostgreSQL database in use. The PostgreSQL cross-schema driver install function assumes Drupal is installed in a PostgreSQL database but that may not be true. Drupal may reside either in a MySQL database or in another PostgreSQL database or server! Therefore, the install may fail as well as the uninstall process. And calling those functions in another PostgreSQL database than the Drupal one will fail as well. Therefore, a different approach should be used.

Steps to reproduce

Not relevant.

Proposed resolution

Instead of trying to install those function in a PostgreSQL Drupal schema, those function should only be loaded when needed and reside in the temporary space of current connection. The use of "pg_temp" schema would solve many problems:

  • it is always available
  • no need to check where Drupal is
  • it would work on multiple and distinct PostgreSQL databases
  • no need to clean after use on external PostgreSQL databases
  • no issue when the module is uninstalled
  • no risks the functions get removed by an external process

Remaining tasks

To implement.

User interface changes

None.

API changes

None.

Data model changes

None.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France guignonv

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.71.5 2024