<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main_dump(paths, directory, dry_run):
 """dump all or part of the prom data, currently only works on Postgres databases basically just a wrapper around `dump backup` https://github.com/Jaymon/dump """

    table_map = get_table_map(paths)

    for conn_name, conn_info in table_map.items():
        inter = conn_info["interface"]
        conn = inter.connection_config
        table_names = conn_info["table_names"]

        cmd = get_base_cmd("backup", inter, directory)
        cmd.extend(table_names)

        if dry_run:
            echo.out(" ".join(cmd))

        else:
            run_cmd(cmd)