SQLStrings.jl
SQLStrings.jl copied to clipboard
ERROR: cannot insert multiple commands into a prepared statement
This may not be an issue, rather just a question. Using LibPQ when I try to execute multiple statements separated by semicolon as one execution (SQLStrings.prepare + LibPQ.execute) I am getting an error [error | LibPQ]: SyntaxError: ERROR: cannot insert multiple commands into a prepared statement
Example:
INSERT INTO test.two_columns VALUES($1, $2);
INSERT INTO test.two_columns VALUES($3, $4)
$1 = 3
$2 = 4
$3 = 4
$4 = 3
At the same time, LibPQ.execute of simple string
"INSERT INTO test.two_columns VALUES(3, 4);
INSERT INTO test.two_columns VALUES(4, 3)"
is successful.
Is this a way how it has to be and each statement has to be executed separately, or there could be something we can do to make it happen? Thank you.
This looks like a limitation (or design decision) of postgres itself so you should split these into separate statements.