Problem/Motivation

While testing the new 7.x-dev release I have run into an issue on one website running on PostgreSQL 12. The problem is with this patch: #2823488: Backport DatabaseSchema_pgsql::queryTableInformation() improvements (originally backported 6 years ago by @mradcliffe). After this patch there seems to be an error on PostgreSQL 12:

PDOException: SQLSTATE[42703]: Undefined column: 7 ERROR: column pg_attrdef.adsrc does not exist LINE 8: OR pg_attrdef.adsrc::text LIKE 'nextval%') ^: SELECT pg_attribute.attname AS column_name, format_type(pg_attribute.atttypid, pg_attribute.atttypmod) AS data_type, pg_get_expr(pg_attrdef.adbin, pg_attribute.attrelid) AS column_default FROM pg_attribute LEFT JOIN pg_attrdef ON pg_attrdef.adrelid = pg_attribute.attrelid AND pg_attrdef.adnum = pg_attribute.attnum WHERE pg_attribute.attnum > 0 AND NOT pg_attribute.attisdropped AND pg_attribute.attrelid = :key::regclass AND (format_type(pg_attribute.atttypid, pg_attribute.atttypmod) = 'bytea' OR pg_attrdef.adsrc LIKE 'nextval%'); Array ( [:key] => public.variable ) in variable_set()

The backport was correct but Drupal 8/9 had an additional patch following the original one, which fixed an issue with PostgreSQL 12 and newer.

The table column pg_attrdef.adsrc has been removed by PostgreSQL in version 12. See: https://www.postgresql.org/docs/current/catalog-pg-attrdef.html

Unfortunately this was not revealed with automated testing because PostgreSQL 12 is not set as the main version to test. The original D8 issue with the patch is here: #3058853: Drupal 8.x on Postgresql 12.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3283311-2.patch605 bytespoker10
#2 3283311-2_noop.patch292 bytespoker10

Comments

poker10 created an issue. See original summary.

poker10’s picture

Status: Active » Needs review
StatusFileSize
new292 bytes
new605 bytes

Backport of the patch for D7 is attached.

mcdruid credited alexpott.

mcdruid credited andypost.

mcdruid credited daffie.

mcdruid credited hubaishan.

mcdruid credited lamigo.

mcdruid credited puddyglum.

mcdruid credited qdelance.

mcdruid credited x0r1x.

mcdruid credited xekon.

mcdruid’s picture

Status: Needs review » Reviewed & tested by the community

Adding credit from the original issue (which I often forget - sorry) + Fabianx who has reviewed this.

  • mcdruid committed 2e260b1 on 7.x
    Issue #3283311 by poker10, hubaishan, daffie, andypost, alexpott,...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for getting this in to the 7.90 release (due tomorrow) and avoiding a hotfix firedrill!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.