You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to execute 2 queries in a single statement
The wire protocol only allows binding params into a single statement.
If you really want to use a single round trip you could use a writable CTE or you could use a Batch to bundle both together. But unless you have a specific reason, I would leave it as two commands.
I understand it is to avoid SQL injections, but I was expecting pgx to have a For function that iterates on each command and executes them independently. But well, from your answer I see that the best for now is to use two commands. So thank you very much for the information.
I would like to execute 2 queries in a single statement that affect two different tables.
This is what I have and it works:
This is what I want:
And this is what I get:
"cannot insert multiple commands into a prepared statement"
It is not in my interest to have them run simultaneously I just want to simplify the code.
The text was updated successfully, but these errors were encountered: