diff options
| author | Mason S | 2010-05-03 20:38:46 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2011-05-19 16:38:45 +0000 |
| commit | 09b657378bf282096f9b690b8d7155377aedff44 (patch) | |
| tree | 3fdc27fce3b7ce7e866248a5eecfb0c0aaa058fd /src/include | |
| parent | f54ce7729b567f5a3d6f8183f8c09185adf337ab (diff) | |
Added support for COPY TO a file or STDOUT.
It currently only supports from a single table, copy with SELECT is not
yet supported.
This was written by Michael Paquier.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/copy.h | 5 | ||||
| -rw-r--r-- | src/include/pgxc/combiner.h | 1 | ||||
| -rw-r--r-- | src/include/pgxc/datanode.h | 3 | ||||
| -rw-r--r-- | src/include/pgxc/locator.h | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index a397b78633..e6eaf5e39e 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -17,8 +17,11 @@ #include "nodes/parsenodes.h" #include "tcop/dest.h" - +#ifdef PGXC +extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString, bool exec_on_coord_portal, bool *executed); +#else extern uint64 DoCopy(const CopyStmt *stmt, const char *queryString); +#endif extern DestReceiver *CreateCopyDestReceiver(void); diff --git a/src/include/pgxc/combiner.h b/src/include/pgxc/combiner.h index 7926cbd9ff..8d8b161ac9 100644 --- a/src/include/pgxc/combiner.h +++ b/src/include/pgxc/combiner.h @@ -50,6 +50,7 @@ typedef struct uint64 copy_out_count; bool inErrorState; List *simple_aggregates; + FILE *copy_file; /* used if copy_dest == COPY_FILE */ } ResponseCombinerData; diff --git a/src/include/pgxc/datanode.h b/src/include/pgxc/datanode.h index 4f75ba24af..28c5d8748e 100644 --- a/src/include/pgxc/datanode.h +++ b/src/include/pgxc/datanode.h @@ -82,8 +82,9 @@ extern int DataNodeRollback(CommandDest dest); extern int DataNodeExec(const char *query, Exec_Nodes *exec_nodes, CombineType combine_type, CommandDest dest, Snapshot snapshot, bool force_autocommit, List *simple_aggregates, bool is_read_only); -extern DataNodeHandle** DataNodeCopyBegin(const char *query, List *nodelist, Snapshot snapshot); +extern DataNodeHandle** DataNodeCopyBegin(const char *query, List *nodelist, Snapshot snapshot, bool is_from); extern int DataNodeCopyIn(char *data_row, int len, Exec_Nodes *exec_nodes, DataNodeHandle** copy_connections); +extern int DataNodeCopyOut(Exec_Nodes *exec_nodes, DataNodeHandle** copy_connections, CommandDest dest, FILE* copy_file); extern uint64 DataNodeCopyFinish(DataNodeHandle** copy_connections, int primary_data_node, CombineType combine_type, CommandDest dest); extern int primary_data_node; diff --git a/src/include/pgxc/locator.h b/src/include/pgxc/locator.h index 1d5280c765..335701c282 100644 --- a/src/include/pgxc/locator.h +++ b/src/include/pgxc/locator.h @@ -73,7 +73,7 @@ extern int GetRoundRobinNode(Oid relid); extern bool IsHashDistributable(Oid col_type); extern List *GetAllNodes(void); -extern int GetAnyDataNode(void); +extern List *GetAnyDataNode(void); extern void RelationBuildLocator(Relation rel); extern void FreeRelationLocInfo(RelationLocInfo * relationLocInfo); |
