parameters: (self, table, new_table)
return_statement: return True
docstring: rename a table
docstring_summary: rename a table
docstring_tokens: rename a table
function: def renameTable(self, table, new_table):
          """ rename a table """
          schema, tablename = self.getSchemaTableName(table)
          if new_table == tablename:
              return
  
          if self.isRasterTable(table):
              return False
  
          c = self._get_cursor()
  
          sql = u"ALTER TABLE %s RENAME TO %s" % (self.quoteId(table), self.quoteId(new_table))
          self._execute(c, sql)
  
          # update geometry_columns
          if self.has_geometry_columns:
              sql = u"UPDATE geometry_columns SET f_table_name = %s WHERE upper(f_table_name) = upper(%s)" % (
                  self.quoteString(new_table), self.quoteString(tablename))
              self._execute(c, sql)
  
          self._commit()
          return True
function_tokens: def renameTable ( self , table , new_table ) : schema , tablename = self . getSchemaTableName ( table ) if new_table == tablename : return if self . isRasterTable ( table ) : return False c = self . _get_cursor ( ) sql = u"ALTER TABLE %s RENAME TO %s" % ( self . quoteId ( table ) , self . quoteId ( new_table ) ) self . _execute ( c , sql ) # update geometry_columns if self . has_geometry_columns : sql = u"UPDATE geometry_columns SET f_table_name = %s WHERE upper(f_table_name) = upper(%s)" % ( self . quoteString ( new_table ) , self . quoteString ( tablename ) ) self . _execute ( c , sql ) self . _commit ( ) return True