22
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.41 2009/02/02 20:07:37 adunstan Exp $
22
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.42 2009/06/11 14:49:07 momjian Exp $
24
24
*-------------------------------------------------------------------------
133
133
AH->StartBlobPtr = _StartBlob;
134
134
AH->EndBlobPtr = _EndBlob;
135
135
AH->EndBlobsPtr = _EndBlobs;
136
AH->ClonePtr = _Clone;
137
AH->DeClonePtr = _DeClone;
136
AH->ClonePtr = _Clone;
137
AH->DeClonePtr = _DeClone;
140
140
* Set up some special context used in compressing data.
842
842
* is because on Windows, this is used within a multithreading context,
843
843
* and we don't want a thread closing the parent file handle.)
846
846
_ReopenArchive(ArchiveHandle *AH)
848
848
lclContext *ctx = (lclContext *) AH->formatData;
851
851
if (AH->mode == archModeWrite)
852
die_horribly(AH,modulename,"can only reopen input archives\n");
852
die_horribly(AH, modulename, "can only reopen input archives\n");
853
853
if (AH->fSpec == NULL || strcmp(AH->fSpec, "") == 0)
854
die_horribly(AH,modulename,"cannot reopen stdin\n");
854
die_horribly(AH, modulename, "cannot reopen stdin\n");
855
855
if (!ctx->hasSeek)
856
die_horribly(AH,modulename,"cannot reopen non-seekable file\n");
856
die_horribly(AH, modulename, "cannot reopen non-seekable file\n");
859
859
tpos = ftello(AH->FH);
861
die_horribly(AH, modulename, "could not determine seek position in archive file: %s\n",
861
die_horribly(AH, modulename, "could not determine seek position in archive file: %s\n",
862
862
strerror(errno));
865
865
if (fclose(AH->FH) != 0)
866
die_horribly(AH, modulename, "could not close archive file: %s\n",
866
die_horribly(AH, modulename, "could not close archive file: %s\n",
867
867
strerror(errno));
873
873
AH->fSpec, strerror(errno));
875
875
if (fseeko(AH->FH, tpos, SEEK_SET) != 0)
876
die_horribly(AH, modulename, "could not set seek position in archive file: %s\n",
876
die_horribly(AH, modulename, "could not set seek position in archive file: %s\n",
877
877
strerror(errno));
1085
1085
die_horribly(AH, modulename, "out of memory\n");
1088
* Note: we do not make a local lo_buf because we expect at most one
1089
* BLOBS entry per archive, so no parallelism is possible. Likewise,
1088
* Note: we do not make a local lo_buf because we expect at most one BLOBS
1089
* entry per archive, so no parallelism is possible. Likewise,
1090
1090
* TOC-entry-local state isn't an issue because any one TOC entry is
1091
1091
* touched by just one worker child.