The PHP postgresql documentation says:
The SQL statement or statements to be executed. When multiple statements are passed to the function, they are automatically executed as one transaction, unless there are explicit BEGIN/COMMIT commands included in the query string. However, using multiple transactions in one function call is not recommended.
But why does it say that multiple transactions are not reccommended? Also, if they are not recommended how would you do something fancy like an upsert?
Also, I wanted to use pg_query_params because it auto-escapes parameters, but it doesn't allow multiple transactions at all. Is there a safe and effective way to do multiple transactions?