Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9d58b964
Commit
9d58b964
authored
Jan 26, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pg_dump and pg_restore handle binary archive formats correctly
when using stdout/stdin on Windows.
parent
889f0381
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+20
-2
No files found.
src/bin/pg_dump/pg_backup_archiver.c
View file @
9d58b964
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.10
3 2005/01/25 22:44:31
tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.10
4 2005/01/26 19:44:43
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -29,6 +29,10 @@
...
@@ -29,6 +29,10 @@
#include <ctype.h>
#include <ctype.h>
#include <unistd.h>
#include <unistd.h>
#ifdef WIN32
#include <io.h>
#endif
#include "pqexpbuffer.h"
#include "pqexpbuffer.h"
#include "libpq/libpq-fs.h"
#include "libpq/libpq-fs.h"
...
@@ -1709,6 +1713,21 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
...
@@ -1709,6 +1713,21 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
AH
->
gzOut
=
0
;
AH
->
gzOut
=
0
;
AH
->
OF
=
stdout
;
AH
->
OF
=
stdout
;
/*
* On Windows, we need to use binary mode to read/write non-text archive
* formats. Force stdin/stdout into binary mode in case that is what
* we are using.
*/
#ifdef WIN32
if
(
fmt
!=
archNull
)
{
if
(
mode
==
archModeWrite
)
setmode
(
fileno
(
stdout
),
O_BINARY
);
else
setmode
(
fileno
(
stdin
),
O_BINARY
);
}
#endif
#if 0
#if 0
write_msg(modulename, "archive format is %d\n", fmt);
write_msg(modulename, "archive format is %d\n", fmt);
#endif
#endif
...
@@ -1720,7 +1739,6 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
...
@@ -1720,7 +1739,6 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
switch
(
AH
->
format
)
switch
(
AH
->
format
)
{
{
case
archCustom
:
case
archCustom
:
InitArchiveFmt_Custom
(
AH
);
InitArchiveFmt_Custom
(
AH
);
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment