On Thu, Oct 31, 2024 at 03:32:39PM +0900, Michael Paquier wrote: > @Tom added in CC: Is there a specific reason why CheckTransactionBlock() > did not include a check based on XACT_FLAGS_PIPELINING when it got > introduced in 20432f873140, while IsInTransactionBlock() considers it?
This also makes LOCK able to work flawlessly within pipelines as far as I can see, as an error would be reported on HEAD. That's nice. The behavior of the first command is interesting, still this saves from the checks after any follow-up commands, and this is intended from what I can see in postgres.c, because the xact flag is only set once the first command completes. Now, here is a fancy case: SAVEPOINT and its two brothers. An error would be reported on HEAD if attempting a SAVEPOINT, complaining that we are not in a transaction block. The patch causes a different, more confusing, failure: FATAL: DefineSavepoint: unexpected state STARTED This is a bit user-unfriendly. I am not sure to see the point of supporting savepoints in this context, so perhaps we should just issue a cleaner error when we are under a XACT_FLAGS_PIPELINING? Reporting that we are not in a transaction block, while, well, we are in an implicit transaction block because of the use of pipelines is confusing. The new error is actually worse. -- Michael
signature.asc
Description: PGP signature