Closed da99 closed 6 years ago
Postgres has two protocols for executing queries. One (extended query) allows parameters and other advanced features, but only one statement at a time. The other (simple query) allows multiple statements, but is very basic.
In order to prevent some problems, we only return results using the extended query protocol. We do support the simple one also (https://github.com/will/crystal-pg/blob/master/src/pg/connection.cr#L29), but don't return results for that, it's intended for creating tables or other DDL.
I think the best way forward is to start a transaction and issue the two statements separately.
Thanks. That cleared a lot of things up for me.
The following SQL fails using the
.query
methods because it has multiple statements:Is there a way to execute this query? Maybe as an unprepared statement?