copy.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*-------------------------------------------------------------------------
  2. *
  3. * copy.h
  4. * Definitions for using the POSTGRES copy command.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2016, 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. #include "nodes/execnodes.h"
  17. #include "nodes/parsenodes.h"
  18. #include "tcop/dest.h"
  19. /* CopyStateData is private in commands/copy.c */
  20. typedef struct CopyStateData *CopyState;
  21. extern Oid DoCopy(const CopyStmt *stmt, const char *queryString,
  22. uint64 *processed);
  23. extern void ProcessCopyOptions(CopyState cstate, bool is_from, List *options);
  24. extern CopyState BeginCopyFrom(Relation rel, const char *filename,
  25. bool is_program, List *attnamelist, List *options);
  26. extern void EndCopyFrom(CopyState cstate);
  27. extern bool NextCopyFrom(CopyState cstate, ExprContext *econtext,
  28. Datum *values, bool *nulls, Oid *tupleOid);
  29. extern bool NextCopyFromRawFields(CopyState cstate,
  30. char ***fields, int *nfields);
  31. extern void CopyFromErrorCallback(void *arg);
  32. extern DestReceiver *CreateCopyDestReceiver(void);
  33. #endif /* COPY_H */