PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
copy.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * copy.h
4  * Definitions for using the POSTGRES copy command.
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/commands/copy.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef COPY_H
15 #define COPY_H
16 
17 #include "nodes/execnodes.h"
18 #include "nodes/parsenodes.h"
19 #include "parser/parse_node.h"
20 #include "tcop/dest.h"
21 
22 /* CopyStateData is private in commands/copy.c */
23 typedef struct CopyStateData *CopyState;
24 typedef int (*copy_data_source_cb) (void *outbuf, int minread, int maxread);
25 
26 extern void DoCopy(ParseState *state, const CopyStmt *stmt,
27  int stmt_location, int stmt_len,
28  uint64 *processed);
29 
30 extern void ProcessCopyOptions(ParseState *pstate, CopyState cstate, bool is_from, List *options);
31 extern CopyState BeginCopyFrom(ParseState *pstate, Relation rel, const char *filename,
33 extern void EndCopyFrom(CopyState cstate);
34 extern bool NextCopyFrom(CopyState cstate, ExprContext *econtext,
35  Datum *values, bool *nulls, Oid *tupleOid);
36 extern bool NextCopyFromRawFields(CopyState cstate,
37  char ***fields, int *nfields);
38 extern void CopyFromErrorCallback(void *arg);
39 
40 extern uint64 CopyFrom(CopyState cstate);
41 
43 
44 #endif /* COPY_H */
uint64 CopyFrom(CopyState cstate)
Definition: copy.c:2273
void EndCopyFrom(CopyState cstate)
Definition: copy.c:3516
unsigned int Oid
Definition: postgres_ext.h:31
bool NextCopyFrom(CopyState cstate, ExprContext *econtext, Datum *values, bool *nulls, Oid *tupleOid)
Definition: copy.c:3275
CopyState BeginCopyFrom(ParseState *pstate, Relation rel, const char *filename, bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options)
Definition: copy.c:2964
bool NextCopyFromRawFields(CopyState cstate, char ***fields, int *nfields)
Definition: copy.c:3223
Relation rel
Definition: copy.c:109
copy_data_source_cb data_source_cb
Definition: copy.c:114
DestReceiver * CreateCopyDestReceiver(void)
Definition: copy.c:4827
bool is_program
Definition: copy.c:113
uintptr_t Datum
Definition: postgres.h:372
void DoCopy(ParseState *state, const CopyStmt *stmt, int stmt_location, int stmt_len, uint64 *processed)
Definition: copy.c:783
Definition: regguts.h:298
static Datum values[MAXATTR]
Definition: bootstrap.c:163
int(* copy_data_source_cb)(void *outbuf, int minread, int maxread)
Definition: copy.h:24
static char * filename
Definition: pg_dumpall.c:90
struct CopyStateData * CopyState
Definition: copy.h:23
void * arg
void ProcessCopyOptions(ParseState *pstate, CopyState cstate, bool is_from, List *options)
Definition: copy.c:1016
Definition: pg_list.h:45
void CopyFromErrorCallback(void *arg)
Definition: copy.c:2168