PostgreSQL Source Code  git master
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-2020, 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
17 #include "nodes/execnodes.h"
18 #include "nodes/parsenodes.h"
19 #include "parser/parse_node.h"
20 #include "tcop/dest.h"
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);
26 extern void DoCopy(ParseState *state, const CopyStmt *stmt,
27  int stmt_location, int stmt_len,
28  uint64 *processed);
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);
36 extern bool NextCopyFromRawFields(CopyState cstate,
37  char ***fields, int *nfields);
38 extern void CopyFromErrorCallback(void *arg);
40 extern uint64 CopyFrom(CopyState cstate);
44 #endif /* COPY_H */
uint64 CopyFrom(CopyState cstate)
Definition: copy.c:2702
void EndCopyFrom(CopyState cstate)
Definition: copy.c:3876
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:3383
bool NextCopyFromRawFields(CopyState cstate, char ***fields, int *nfields)
Definition: copy.c:3639
bool NextCopyFrom(CopyState cstate, ExprContext *econtext, Datum *values, bool *nulls)
Definition: copy.c:3691
Relation rel
Definition: copy.c:130
copy_data_source_cb data_source_cb
Definition: copy.c:135
DestReceiver * CreateCopyDestReceiver(void)
Definition: copy.c:5201
bool is_program
Definition: copy.c:134
uintptr_t Datum
Definition: postgres.h:367
void DoCopy(ParseState *state, const CopyStmt *stmt, int stmt_location, int stmt_len, uint64 *processed)
Definition: copy.c:888
Definition: regguts.h:298
int(* copy_data_source_cb)(void *outbuf, int minread, int maxread)
Definition: copy.h:24
static Datum values[MAXATTR]
Definition: bootstrap.c:167
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:1156
Definition: pg_list.h:50
void CopyFromErrorCallback(void *arg)
Definition: copy.c:2284