@staticmethod
def derive_field_length(column):
    """
        Returns the width of a field based on the data type of column.

        :param dict column: The column of which the field is based.

        :rtype: int
        """
    types_length = {'bigint': 21, 'integer': 11, 'smallint': 6, 'bit':
        column['character_maximum_length'], 'money': None, 'boolean': None,
        'double': column['numeric_precision'], 'numeric': column[
        'numeric_precision'], 'real': None, 'character': column[
        'character_maximum_length'], 'character varying': column[
        'character_maximum_length'], 'point': None, 'polygon': None, 'text':
        None, 'bytea': None, 'xml': None, 'USER-DEFINED': None,
        'timestamp without time zone': 16, 'time without time zone': 8,
        'date': 10}
    if column['data_type'] in types_length:
        return types_length[column['data_type']]
    raise Exception("Unexpected type '{0!s}'.".format(column['data_type']))
