def _alter_sequence(cr, seq_name, number_increment=None, number_next=None):
 if (number_increment == 0):
  raise UserError(_('Step must not be zero.'))
 cr.execute('SELECT relname FROM pg_class WHERE relkind=%s AND relname=%s', ('S', seq_name))
 if (not cr.fetchone()):
  return
 statement = ('ALTER SEQUENCE %s' % (seq_name,))
 if (number_increment is not None):
  statement += (' INCREMENT BY %d' % (number_increment,))
 if (number_next is not None):
  statement += (' RESTART WITH %d' % (number_next,))
 cr.execute(statement)

def _alter_sequence ( cr , seq_name , number_increment = None , number_next = None ) : if ( number_increment == 0 ) : raise UserError ( _ ( 'Step must not be zero.' ) ) cr . execute ( 'SELECT relname FROM pg_class WHERE relkind=%s AND relname=%s' , ( 'S' , seq_name ) ) if ( not cr . fetchone ( ) ) : return statement = ( 'ALTER SEQUENCE %s' % ( seq_name , ) ) if ( number_increment is not None ) : statement += ( ' INCREMENT BY %d' % ( number_increment , ) ) if ( number_next is not None ) : statement += ( ' RESTART WITH %d' % ( number_next , ) ) cr . execute ( statement )
alter a postresql sequence .