diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php index 9e5e1d9f841c6a94a81b8682e1ab6dab20f7978e..26f4e3ebe3e7be8851b393a14f7d7cbcca76e421 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -628,6 +628,15 @@ public function fieldSetNoDefault($table, $field) { $this->connection->query('ALTER TABLE {' . $table . '} ALTER COLUMN "' . $field . '" DROP DEFAULT'); } + /** + * {@inheritdoc} + */ + public function fieldExists($table, $column) { + $prefixInfo = $this->getPrefixInfo($table); + + return (bool) $this->connection->query("SELECT 1 FROM pg_attribute WHERE attrelid = :key::regclass AND attname = :column AND NOT attisdropped AND attnum > 0", array(':key' => $prefixInfo['schema'] . '.' . $prefixInfo['table'], ':column' => $column))->fetchField(); + } + /** * {@inheritdoc} */