Skip to content

Commit

Permalink
disable COPY feature for Windows (because of unresolved external symb…
Browse files Browse the repository at this point in the history
…ol errors)
  • Loading branch information
zilder committed Oct 12, 2016
1 parent d630bf0 commit 22085cd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/copy_stmt_hooking.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@
#include "libpq/libpq.h"


/*
* While building PostgreSQL on Windows the msvc compiler produces .def file
* which contains all the symbols that were declared as external except the ones
* that were declared but not defined. We redefine variables below to prevent
* 'unresolved symbol' errors on Windows. But we have to disable COPY feature
* on Windows
*/
#ifdef WIN32
bool XactReadOnly = false;
ProtocolVersion FrontendProtocol = (ProtocolVersion) 0;
#endif


static uint64 PathmanCopyFrom(CopyState cstate,
Relation parent_rel,
List *range_table,
Expand Down Expand Up @@ -95,6 +108,11 @@ is_pathman_related_copy(Node *parsetree)
}

elog(DEBUG1, "Overriding default behavior for COPY [%u]", partitioned_table);

#ifdef WIN32
elog(ERROR, "COPY is not supported for partitioned tables on Windows");
#endif

return true;
}

Expand Down

0 comments on commit 22085cd

Please sign in to comment.