Bruce Momjian <bruce@momjian.us> writes:
> Do we need a TODO for this?
Well, if we *don't* change the backend to disallow multi statements per
PQexec, then we'd probably better do something about this. If we do
make that change then it's not a problem anymore.
>> Hm, that's an interesting point. psql's -c just shoves its whole
>> argument string at the backend in one PQexec(), instead of dividing
>> at semicolons as psql does with normal input. And so it winds up as
>> a single transaction because postgres.c doesn't force a transaction
>> commit until the end of the querystring. But that's not a "transaction
>> block" in the normal sense and so it doesn't trigger the
>> PreventTransactionChain defense in CREATE DATABASE and elsewhere.
regards, tom lane