Skip to content

Commit b803886

Browse files
committed
Merge branch 'master_pgpro_copy' into rel_1_2_beta
2 parents b94b2c1 + 561b501 commit b803886

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/copy_stmt_hooking.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,21 @@
3535
#include "libpq/libpq.h"
3636

3737

38+
/*
39+
* Determine whether we should enable COPY or not (PostgresPro has a fix).
40+
*/
41+
#if defined(WIN32) && !defined(PGPRO_PATHMAN_AWARE_COPY)
42+
#define DISABLE_PATHMAN_COPY
43+
#endif
44+
3845
/*
3946
* While building PostgreSQL on Windows the msvc compiler produces .def file
4047
* which contains all the symbols that were declared as external except the ones
4148
* that were declared but not defined. We redefine variables below to prevent
4249
* 'unresolved symbol' errors on Windows. But we have to disable COPY feature
43-
* on Windows
50+
* on Windows.
4451
*/
45-
#ifdef WIN32
52+
#ifdef DISABLE_PATHMAN_COPY
4653
bool XactReadOnly = false;
4754
ProtocolVersion FrontendProtocol = (ProtocolVersion) 0;
4855
#endif
@@ -107,10 +114,12 @@ is_pathman_related_copy(Node *parsetree)
107114
elog(ERROR, "freeze is not supported for partitioned tables");
108115
}
109116

110-
elog(DEBUG1, "Overriding default behavior for COPY [%u]", partitioned_table);
111-
112-
#ifdef WIN32
117+
/* Emit ERROR if we can't see the necessary symbols */
118+
#ifdef DISABLE_PATHMAN_COPY
113119
elog(ERROR, "COPY is not supported for partitioned tables on Windows");
120+
#else
121+
elog(DEBUG1, "Overriding default behavior for COPY [%u]",
122+
partitioned_table);
114123
#endif
115124

116125
return true;

0 commit comments

Comments
 (0)