:)
I forgot to mention I experienced it being connected to postgresql (9.6) using libpg.

I mentioned I'm familiar with such error because I experienced it writing PHP application with use of PDO. And it's true, prepare statement works only for single SQL queries. This is why the error is rised. Point is, sending plain SQLs prepare statements are never used until executed explicitly by SQL syntax.
In case of my application I found a solution by enabling following option of the connector: PDO::ATTR_EMULATE_PREPARES.

Last edited by michalk on Tue Jan 23, 2018 10:12 am; edited 1 time in total

Tue Jan 23, 2018 10:10 am

SysOpSite Admin

Joined: 26 Nov 2006Posts: 6608

Got it. You have two options to get it work with SASE

Execute BEGIN; separately to start a transaction, after that run the rest of logical code block. Or you can use plpgsql DO anonymous blocks. E.g.

Yes I know both ways. But it doesn't match my needs.
We work with a bit bigger multi-line scripts, which are composed with anonymous blocks as well as simple queries like calling functions etc. And whole script has to be executed in single transaction of fail being automatically rolled back.
It is how it works using pgAdmin and other tools. Without it, SA Editor is no go to us.

I't would be very useful to have ability to run multi command SQLSs without need of dodging app limitations. In that particular case we don't expect result of all subsequent queries (As SAEditor does). The result of the last one, and total time spend on the script is obviously enough.