postgresqlplpgsql

Can 2 postgresql functions be called in parallel?


CREATE OR REPLACE FUNCTION wrapperFunction()
  RETURNS bytea AS
$BODY$
BEGIN
    SELECT function1() || function2();
END;
$BODY$
  LANGUAGE plpgsql

Is there a way to make calls to function1 and function2 parallel?

(they are read only, no side effects and independent)


Solution

  • No, you cannot do that.

    To call two functions in parallel, you need to have two database sessions.