Skip to content

Commit 22085cd

Browse files
committed
disable COPY feature for Windows (because of unresolved external symbol errors)
1 parent d630bf0 commit 22085cd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/copy_stmt_hooking.c

+18
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@
3535
#include "libpq/libpq.h"
3636

3737

38+
/*
39+
* While building PostgreSQL on Windows the msvc compiler produces .def file
40+
* which contains all the symbols that were declared as external except the ones
41+
* that were declared but not defined. We redefine variables below to prevent
42+
* 'unresolved symbol' errors on Windows. But we have to disable COPY feature
43+
* on Windows
44+
*/
45+
#ifdef WIN32
46+
bool XactReadOnly = false;
47+
ProtocolVersion FrontendProtocol = (ProtocolVersion) 0;
48+
#endif
49+
50+
3851
static uint64 PathmanCopyFrom(CopyState cstate,
3952
Relation parent_rel,
4053
List *range_table,
@@ -95,6 +108,11 @@ is_pathman_related_copy(Node *parsetree)
95108
}
96109

97110
elog(DEBUG1, "Overriding default behavior for COPY [%u]", partitioned_table);
111+
112+
#ifdef WIN32
113+
elog(ERROR, "COPY is not supported for partitioned tables on Windows");
114+
#endif
115+
98116
return true;
99117
}
100118

0 commit comments

Comments
 (0)