Thread: TBLOCK status from libpq / libpq++

TBLOCK status from libpq / libpq++

From
Yu Cao
Date:
Is there a way I can find out whether I'm inside a transaction
block (between "BEGIN" and "END") by calling some libpq function?
The transaction state referred to in backend/access/transam/xact.c
seems buried too deep to be accessible from libpq.

Thanks for any help.

--Yu Cao



Re: [INTERFACES] TBLOCK status from libpq / libpq++

From
Tom Lane
Date:
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