diff -u b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php --- b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php @@ -1,4 +1,9 @@ connection->query($sql, [ ':key' => $key, ]); @@ -187,7 +190,6 @@ */ protected function getTempNamespaceName() { if (!isset($this->tempNamespaceName)) { - // cSpell:disable-next-line $this->tempNamespaceName = $this->connection->query('SELECT nspname FROM pg_namespace WHERE oid = pg_my_temp_schema()')->fetchField(); } return $this->tempNamespaceName; @@ -242,7 +244,6 @@ $this->connection->addSavepoint(); try { - // cSpell:disable-next-line $checks = $this->connection->query("SELECT conname FROM pg_class cl INNER JOIN pg_constraint co ON co.conrelid = cl.oid INNER JOIN pg_attribute attr ON attr.attrelid = cl.oid AND attr.attnum = ANY (co.conkey) INNER JOIN pg_namespace ns ON cl.relnamespace = ns.oid WHERE co.contype = :constraint_type AND ns.nspname = :schema AND cl.relname = :table AND attr.attname = :column", [ ':constraint_type' => $constraint_type, ':schema' => $schema, @@ -496,7 +497,6 @@ public function tableExists($table) { $prefixInfo = $this->getPrefixInfo($table, TRUE); - // cSpell:disable-next-line return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", [':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']])->fetchField(); } @@ -511,7 +511,6 @@ // Load all the tables up front in order to take into account per-table // prefixes. The actual matching is done at the bottom of the method. - // cSpell:disable-next-line $results = $this->connection->query("SELECT tablename FROM pg_tables WHERE schemaname = :schema", [':schema' => $this->defaultSchema]); foreach ($results as $table) { // Take into account tables that have an individual prefix. @@ -564,7 +563,6 @@ // Index names and constraint names are global in PostgreSQL, so we need to // rename them when renaming the table. - // cSpell:disable-next-line $indexes = $this->connection->query('SELECT indexname FROM pg_indexes WHERE schemaname = :schema AND tablename = :table', [':schema' => $old_schema, ':table' => $old_table_name]); foreach ($indexes as $index) { @@ -709,7 +707,6 @@ public function fieldExists($table, $column) { $prefixInfo = $this->getPrefixInfo($table); - // cSpell:disable-next-line return (bool) $this->connection->query("SELECT 1 FROM pg_attribute WHERE attrelid = :key::regclass AND attname = :column AND NOT attisdropped AND attnum > 0", [':key' => $prefixInfo['schema'] . '.' . $prefixInfo['table'], ':column' => $column])->fetchField(); } @@ -791,7 +788,6 @@ if (!$this->tableExists($table)) { return FALSE; } - // cSpell:disable-next-line return $this->connection->query("SELECT array_position(i.indkey, a.attnum) AS position, a.attname FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) WHERE i.indrelid = '{" . $table . "}'::regclass AND i.indisprimary ORDER BY position")->fetchAllKeyed(); } @@ -867,7 +863,6 @@ // Get the schema and tablename for the table without identifier quotes. $full_name = str_replace('"', '', $this->connection->prefixTables('{' . $table . '}')); - // cSpell:disable-next-line $result = $this->connection->query("SELECT i.relname AS index_name, a.attname AS column_name FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND a.attnum = ANY(ix.indkey) AND t.relkind = 'r' AND t.relname = :table_name ORDER BY index_name ASC, column_name ASC", [ ':table_name' => $full_name, ])->fetchAll(); @@ -1033,11 +1028,9 @@ $info = $this->getPrefixInfo($table); // Don't use {} around pg_class, pg_attribute tables. if (isset($column)) { - // cSpell:disable-next-line return $this->connection->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', [$info['table'], $column])->fetchField(); } else { - // cSpell:disable-next-line return $this->connection->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', ['pg_class', $info['table']])->fetchField(); } }