Yu Cao <yucao@falcon.kla-tencor.com> writes:
> Is there a way I can find out whether I'm inside a transaction
> block (between "BEGIN" and "END") by calling some libpq function?
No, libpq has no idea what the backend's status is. If you need to
know this, I suggest keeping track of it in your own application code.
regards, tom lane