def function_name_map(server_version):
    """
    Return a map with function and directory names according to the current
    PostgreSQL version.

    Each entry has the `current` name as key and the name for the specific
    version as value.

    :param number|None server_version: Version of PostgreSQL as returned by
        psycopg2 (i.e. 90301 represent PostgreSQL 9.3.1). If the version
        is None, default to the latest PostgreSQL version
    :rtype: dict[str]
    """
    if server_version and server_version < 100000:
        return {'pg_switch_wal': 'pg_switch_xlog', 'pg_walfile_name':
            'pg_xlogfile_name', 'pg_wal': 'pg_xlog',
            'pg_walfile_name_offset': 'pg_xlogfile_name_offset',
            'pg_last_wal_replay_lsn': 'pg_last_xlog_replay_location',
            'pg_current_wal_lsn': 'pg_current_xlog_location',
            'pg_current_wal_insert_lsn': 'pg_current_xlog_insert_location',
            'pg_last_wal_receive_lsn': 'pg_last_xlog_receive_location',
            'sent_lsn': 'sent_location', 'write_lsn': 'write_location',
            'flush_lsn': 'flush_location', 'replay_lsn': 'replay_location'}
    return {'pg_switch_wal': 'pg_switch_wal', 'pg_walfile_name':
        'pg_walfile_name', 'pg_wal': 'pg_wal', 'pg_walfile_name_offset':
        'pg_walfile_name_offset', 'pg_last_wal_replay_lsn':
        'pg_last_wal_replay_lsn', 'pg_current_wal_lsn':
        'pg_current_wal_lsn', 'pg_current_wal_insert_lsn':
        'pg_current_wal_insert_lsn', 'pg_last_wal_receive_lsn':
        'pg_last_wal_receive_lsn', 'sent_lsn': 'sent_lsn', 'write_lsn':
        'write_lsn', 'flush_lsn': 'flush_lsn', 'replay_lsn': 'replay_lsn'}
