Open
Description
This has been asked before (e.g. #1763), and the answer was to just use query()
. However, this no longer seems to work:
severity: ERROR
code: 42601
file: postgres.c
line: 1400
routine: exec_parse_message
name: Error
message: cannot insert multiple commands into a prepared statement
This is at least the case with the native driver.
What is the correct way to split SQL file by query and execute it?
StackOverflow suggests adhoc implementations such as this: https://stackoverflow.com/a/22659240/368691 However, they are utterly unsafe (any SQL that includes ;
will break).