Glossary: PostgreSQL Beyond the Basics
\gexec
Also written: gexec
A psql command, written in place of the final semicolon, that runs each value the query returns as its own SQL statement. It is used to generate repetitive statements with a query, such as creating many partitions at once.