def METHOD_NAME(psql_query):
    psql_cmd = None
    psql_common_args = ['-U', 'postgres', '-d', 'yugaware', '-h', 'localhost', '-t']
    if args.install_type == "standalone":
        psql_cmd = ["psql"]
        psql_cmd.extend(psql_common_args)
        psql_cmd.extend(["-c", psql_query])
    elif args.install_type == "docker":
        if os.system("sudo docker ps -a | grep postgres > /dev/null") != 0:
            msg_exit("postgres docker container is not running.")
        psql_cmd = "sudo docker exec postgres psql".split(" ")
        psql_cmd.extend(psql_common_args)
        psql_cmd.extend(["-c", psql_query])
    elif args.install_type == "kubernetes":
        kubectl_cmd_prefix = get_kubectl_cmd_prefix()
        pod_name = args.pod
        if not pod_name:
            pod_name = get_running_pod(kubectl_cmd_prefix)
        remote_sql_filepath = remote_copy_psql_query(pod_name, psql_query)
        psql_cmd = kubectl_cmd_prefix
        psql_cmd.extend(['exec', pod_name, '-t', '-c', 'postgres', '--', "psql"])
        psql_cmd.extend(psql_common_args)
        psql_cmd.extend(["-f", remote_sql_filepath])
    else:
        msg_exit("Unknown install type: {}.".format(args.install_type))
    return str(subprocess.check_output(psql_cmd).decode('utf-8')).strip()