pg_show_plans breaks commands that cannot run in a transaction block
ahouska opened this issue · 1 comments
For example cybertec-postgresql/pg_squeeze#32 (comment)
I think that pg_show_plans extension should catch ERRORs raised by the query (see PG_TRY() in PG core), and if an ERROR gets caught, then pg_show_plans should abort the transaction it started for the query and let that query run without being intercepted.
The reason why the pg_create_logical_replication_slot() function made error when using pg_show_plans was the CreateInitDecodingContext() function invoked by the pg_create_logical_replication_slot() function and the GetTopTransactionId() function invoked by pg_show_plans module make a conflict.
See the workaround section in README.
https://github.com/cybertec-postgresql/pg_show_plans#workaround
By the commit shown below, pg_show_plans does not invoke GetTopTransactionId() by default in order to reduce Txid consumption.
1e3b8a3
Therefore, in the current version, this issue does not occur by the default setting (and the workaround is provided even if not default.).
However, error detection by TRY CATCH is useful for the safety runs, so I have implemented it.