When a pipeline is operating on a transaction, it won't be possible to issue queries on the fly underneath the libpqxx API. This will break some existing features that may issue queries at unexpected moments:
- Getting/setting of variables.
- Execution of prepared statements.
- Anything else..?
Perhaps the simplest solution would be to drain any existing pipeline first. Still, that may create new complications.
Another approach is to insert a new layer into internal command execution that goes through an existing pipeline if needed. Even things like transaction bracketing could be layered on top of that (so perhaps subtransactions could be made to work inside pipelines!) and perhaps this layer could be instructed to allocate a temporary pipeline if none is active.