'Postgres parallel queries

How can we execute multiple queries written in stored proc in parallel.:

Create table a as select * from x;

Create table b as select * from y;

Create table c as select * from z;

For ex these three queries should be executed concurrently



Solution 1:[1]

You cannot do that.

You would have to start those queries in three distinct database sessions; that is the way to do parallelization in PostgreSQL.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Laurenz Albe