reverted: --- b/core/lib/Drupal/Core/Database/Connection.php +++ a/core/lib/Drupal/Core/Database/Connection.php @@ -490,45 +490,6 @@ return $this->prefixTables('{' . $table . '}_' . $field . '_seq'); } - /** - * Retrieves a sequence owned by a table and column. - * - * @param string $table - * A table name that is not prefixed or quoted. - * @param string $column - * The column name. - * - * @return string|null - * The name of the sequence or NULL if it does not exist. - */ - public function getSequence($table, $column) { - $args = [ - ':table' => $this->prefixTables('{' . $table . '}'), - ':column' => $column, - ]; - return $this - ->query("SELECT pg_get_serial_sequence(:table, :column)", $args) - ->fetchField(); - } - - /** - * Checks if a sequence exists at all. - * - * @param string $name - * The fully-qualified sequence name. - * - * @return bool - * TRUE if the sequence exists by the name. - * - * @see \Drupal\Core\Database\Connection::makeSequenceName() - */ - public function sequenceExists($name) { - $args = [':name' => $name]; - return (bool) $this - ->query("SELECT c.relname FROM pg_class as c INNER JOIN pg_namespace as ns ON (c.relnamespace = ns.oid) WHERE c.relkind = 'S' AND c.relname = :name", $args) - ->fetchField(); - } - /** * Flatten an array of query comments into a single comment string. * only in patch2: unchanged: --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php @@ -454,6 +454,45 @@ public function upsert($table, array $options = []) { return new $class($this, $table, $options); } + /** + * Retrieves a sequence owned by a table and column. + * + * @param string $table + * A table name that is not prefixed or quoted. + * @param string $column + * The column name. + * + * @return string|null + * The name of the sequence or NULL if it does not exist. + */ + public function getSequence($table, $column) { + $args = [ + ':table' => $this->prefixTables('{' . $table . '}'), + ':column' => $column, + ]; + return $this + ->query("SELECT pg_get_serial_sequence(:table, :column)", $args) + ->fetchField(); + } + + /** + * Checks if a sequence exists at all. + * + * @param string $name + * The fully-qualified sequence name. + * + * @return bool + * TRUE if the sequence exists by the name. + * + * @see \Drupal\Core\Database\Connection::makeSequenceName() + */ + public function sequenceExists($name) { + $args = [':name' => $name]; + return (bool) $this + ->query("SELECT c.relname FROM pg_class as c INNER JOIN pg_namespace as ns ON (c.relnamespace = ns.oid) WHERE c.relkind = 'S' AND c.relname = :name", $args) + ->fetchField(); + } + } /**