    # File lib/active_record/connection_adapters/postgresql_adapter.rb, line 251
          def reset_pk_sequence!(table, pk = nil, sequence = nil)
            unless pk and sequence
              default_pk, default_sequence = pk_and_sequence_for(table)
              pk ||= default_pk
              sequence ||= default_sequence
            end
            if pk
              if sequence
                select_value "SELECT setval('\#{sequence}', (SELECT COALESCE(MAX(\#{pk})+(SELECT increment_by FROM \#{sequence}), (SELECT min_value FROM \#{sequence})) FROM \#{table}), false)\n", 'Reset sequence'
              else
                @logger.warn "#{table} has primary key #{pk} with no default sequence" if @logger
              end
            end
          end