Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5f6de23

Browse files
committed
Protect from ATX.
1 parent 50c8348 commit 5f6de23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/hooks.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "xact_handling.h"
2828

2929
#include "access/transam.h"
30+
#include "access/xact.h"
3031
#include "catalog/pg_authid.h"
3132
#include "miscadmin.h"
3233
#include "optimizer/cost.h"
@@ -770,6 +771,11 @@ pathman_post_parse_analyze_hook(ParseState *pstate, Query *query)
770771
if (!IsPathmanReady())
771772
return;
772773

774+
#if defined(PGPRO_EE)
775+
if (getNestLevelATX() != 0)
776+
elog(FATAL, "pg_pathman extension is not compatible with autonomous transactions and connection pooling");
777+
#endif /* PGPRO_EE */
778+
773779
/* Process inlined SQL functions (we've already entered planning stage) */
774780
if (IsPathmanReady() && get_planner_calls_count() > 0)
775781
{

0 commit comments

Comments
 (0)