diff options
Diffstat (limited to 'src/bin/pg_dump/pg_backup_archiver.h')
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index 8a3a6f9e222..45c9139bc06 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -134,6 +134,20 @@ typedef size_t (*CustomOutPtr) (struct _archiveHandle * AH, const void *buf, siz typedef enum { + SQL_SCAN = 0, /* normal */ + SQL_IN_SINGLE_QUOTE, /* '...' literal */ + SQL_IN_DOUBLE_QUOTE /* "..." identifier */ +} sqlparseState; + +typedef struct +{ + sqlparseState state; /* see above */ + bool backSlash; /* next char is backslash quoted? */ + PQExpBuffer curCmd; /* incomplete line (NULL if not created) */ +} sqlparseInfo; + +typedef enum +{ STAGE_NONE = 0, STAGE_INITIALIZING, STAGE_PROCESSING, @@ -142,6 +156,13 @@ typedef enum typedef enum { + OUTPUT_SQLCMDS = 0, /* emitting general SQL commands */ + OUTPUT_COPYDATA, /* writing COPY data */ + OUTPUT_OTHERDATA /* writing data as INSERT commands */ +} ArchiverOutput; + +typedef enum +{ REQ_SCHEMA = 1, REQ_DATA = 2, REQ_ALL = REQ_SCHEMA + REQ_DATA @@ -167,6 +188,8 @@ typedef struct _archiveHandle * Added V1.7 */ ArchiveFormat format; /* Archive format */ + sqlparseInfo sqlparse; /* state for parsing INSERT data */ + time_t createDate; /* Date archive created */ /* @@ -217,7 +240,7 @@ typedef struct _archiveHandle PGconn *connection; int connectToDB; /* Flag to indicate if direct DB connection is * required */ - bool writingCopyData; /* True when we are sending COPY data */ + ArchiverOutput outputKind; /* Flag for what we're currently writing */ bool pgCopyIn; /* Currently in libpq 'COPY IN' mode. */ int loFd; /* BLOB fd */ |