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
9cbb5fcd
Commit
9cbb5fcd
authored
Oct 24, 2000
by
Philip Warner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes to TAR header format
Fix for endian bug in TAR output Nicer error messages in pg_dump
parent
db2faa94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
15 deletions
+37
-15
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+1
-1
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+18
-12
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+18
-2
No files found.
src/bin/pg_dump/pg_backup_archiver.h
View file @
9cbb5fcd
...
...
@@ -62,7 +62,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 4
#define K_VERS_REV
19
#define K_VERS_REV
20
/* Data block types */
#define BLK_DATA 1
...
...
src/bin/pg_dump/pg_backup_tar.c
View file @
9cbb5fcd
...
...
@@ -673,8 +673,8 @@ static void _LoadBlobs(ArchiveHandle* AH, RestoreOptions *ropt)
static
int
_WriteByte
(
ArchiveHandle
*
AH
,
const
int
i
)
{
lclContext
*
ctx
=
(
lclContext
*
)
AH
->
formatData
;
int
res
;
int
b
=
i
;
int
res
;
char
b
=
i
;
/* Avoid endian problems */
res
=
tarWrite
(
&
b
,
1
,
ctx
->
FH
);
if
(
res
!=
EOF
)
{
...
...
@@ -1088,28 +1088,34 @@ static void _tarWriteHeader(TAR_MEMBER* th)
sprintf
(
&
h
[
100
],
"100600 "
);
/* User ID 8 */
sprintf
(
&
h
[
108
],
"
0 "
);
sprintf
(
&
h
[
108
],
"
0400
0 "
);
/* Group 8 */
sprintf
(
&
h
[
116
],
"
0 "
);
sprintf
(
&
h
[
116
],
"
0200
0 "
);
/* File size 12 */
sprintf
(
&
h
[
124
],
"%1
2o
"
,
th
->
fileLen
);
sprintf
(
&
h
[
124
],
"%1
0o
"
,
th
->
fileLen
);
/* Mod Time 12 */
sprintf
(
&
h
[
136
],
"%1
2o
"
,
(
int
)
time
(
NULL
));
sprintf
(
&
h
[
136
],
"%1
0o
"
,
(
int
)
time
(
NULL
));
/* Checksum 8 */
sprintf
(
&
h
[
148
],
"%
8o
"
,
lastSum
);
sprintf
(
&
h
[
148
],
"%
6o
"
,
lastSum
);
/* Link 1 */
sprintf
(
&
h
[
156
],
"%c"
,
LF_NORMAL
);
/* Type 1 */
/* sprintf(&h[156], "%c", LF_NORMAL); */
sprintf
(
&
h
[
156
],
"0"
);
/* Link name 100 (NULL) */
/* Magic 8 */
sprintf
(
&
h
[
257
],
"ustar "
);
/* GNU Version...
* sprintf(&h[257], "ustar");
* sprintf(&h[263], "00");
*/
/* User 32 */
sprintf
(
&
h
[
265
],
"%.31s"
,
""
);
/* How do I get username reliably? Do I need to? */
...
...
@@ -1117,15 +1123,15 @@ static void _tarWriteHeader(TAR_MEMBER* th)
sprintf
(
&
h
[
297
],
"%.31s"
,
""
);
/* How do I get group reliably? Do I need to? */
/* Maj Dev 8 */
/* sprintf(&h[329], "%
8o
", 0); */
/* sprintf(&h[329], "%
6o
", 0); */
/* Min Dev */
/* sprintf(&h[337], "%
8o
", 0); */
/* sprintf(&h[337], "%
6o
", 0); */
while
(
(
sum
=
_tarChecksum
(
h
))
!=
lastSum
)
{
sprintf
(
&
h
[
148
],
"%
8o
"
,
sum
);
sprintf
(
&
h
[
148
],
"%
6o
"
,
sum
);
lastSum
=
sum
;
}
...
...
src/bin/pg_dump/pg_dump.c
View file @
9cbb5fcd
...
...
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.17
5 2000/10/24 01:38:32 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.17
6 2000/10/24 13:24:30 pjw
Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -696,7 +696,7 @@ main(int argc, char **argv)
if
(
strcmp
(
progname
,
"pg_backup"
)
==
0
)
{
format
=
"c"
;
outputBlobs
=
1
;
outputBlobs
=
true
;
}
#ifdef HAVE_GETOPT_LONG
...
...
@@ -864,6 +864,14 @@ main(int argc, char **argv)
}
}
if
(
optind
<
(
argc
-
1
))
{
fprintf
(
stderr
,
"%s: extra parameters found on command line after '%s' (first is '%s').
\n
"
"Please respecify command.
\n
Use -? for help on invocation options.
\n
"
,
progname
,
argv
[
optind
],
argv
[
optind
+
1
]);
exit
(
1
);
}
if
(
dataOnly
&&
schemaOnly
)
{
fprintf
(
stderr
,
...
...
@@ -888,6 +896,14 @@ main(int argc, char **argv)
exit
(
1
);
}
if
(
outputBlobs
==
true
&&
(
format
[
0
]
==
'p'
||
format
[
0
]
==
'P'
)
)
{
fprintf
(
stderr
,
"%s: BLOB output is not supported for plain text dump files. Use a different output format.
\n
"
,
progname
);
exit
(
1
);
}
/* open the output file */
switch
(
format
[
0
])
{
...
...
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