rdbms: Remove references to pg_attrdef.adsrc in Postgres code
authorJeff Janes <jeff.janes@gmail.com>
Thu, 17 Jan 2019 23:41:51 +0000 (18:41 -0500)
committerKrinkle <krinklemail@gmail.com>
Tue, 22 Jan 2019 19:23:06 +0000 (19:23 +0000)
commit27d342ef4bd31da48b0e10655daf1320e3d00b50
tree21c72063ce477a0a7b69660163567974b5ee0159
parent68365afbb47ef8af79042fca6a0b3fa2acbefe2c
rdbms: Remove references to pg_attrdef.adsrc in Postgres code

PostgreSQL v12 will remove the long-deprecated column
pg_attrdef.adsrc.  The supported way to introspect into column
default values is pg_get_expr(adbin, adrelid), which works
back through all versions of PostgreSQL supported by wikimedia.

Changing to the supported method will allow the upcoming v12 of the
database to be used while maintaining compatibility with older
versions, without needing to write version-specific code.

This patch has been tested with maintenance/update.php and
with phpunit in PostgreSQL versions 9.2, 11, and 12dev.  It does
not harm the first two, and fixes errors that would otherwise
arise in the dev version.  All unit tests which pass under version
11 now pass under 12dev as well.

Change-Id: I874d347fd286b26773113d4f0c6c30d9a4055ad3
includes/libs/rdbms/database/DatabasePostgres.php
includes/libs/rdbms/field/PostgresField.php