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
fc5c577e
Commit
fc5c577e
authored
Oct 25, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow fseeko in pg_dump only if fseeko() will work for all supported file
sizes.
parent
2908a838
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
13 deletions
+41
-13
src/bin/pg_dump/common.c
src/bin/pg_dump/common.c
+2
-2
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+27
-1
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+3
-1
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+3
-3
src/bin/pg_dump/pg_backup_files.c
src/bin/pg_dump/pg_backup_files.c
+3
-3
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+3
-3
No files found.
src/bin/pg_dump/common.c
View file @
fc5c577e
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
1 2002/10/09 16:20:25
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.7
2 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
src/bin/pg_dump/pg_backup_archiver.c
View file @
fc5c577e
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.
59 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.
60 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2338,6 +2338,32 @@ ReadHead(ArchiveHandle *AH)
}
/*
* checkSeek
* check to see if fseek can be performed.
*/
bool
checkSeek
(
FILE
*
fp
)
{
if
(
fseek
(
fp
,
0
,
SEEK_CUR
)
!=
0
)
return
false
;
else
if
(
sizeof
(
off_t
)
>
sizeof
(
long
))
/*
* At this point, off_t is too large for long, so we return
* based on whether an off_t version of fseek is available.
*/
#ifdef HAVE_FSEEKO
return
true
;
#else
return
false
;
#endif
else
return
true
;
}
static
void
_SortToc
(
ArchiveHandle
*
AH
,
TocSortCompareFn
fn
)
{
...
...
src/bin/pg_dump/pg_backup_archiver.h
View file @
fc5c577e
...
...
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
8 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
9 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -27,6 +27,7 @@
#include "postgres_fe.h"
#include <stdio.h>
#include <time.h>
#include <errno.h>
...
...
@@ -284,6 +285,7 @@ extern void ReadToc(ArchiveHandle *AH);
extern
void
WriteDataChunks
(
ArchiveHandle
*
AH
);
extern
int
TocIDRequired
(
ArchiveHandle
*
AH
,
int
id
,
RestoreOptions
*
ropt
);
extern
bool
checkSeek
(
FILE
*
fp
);
/*
* Mandatory routines for each supported format
...
...
src/bin/pg_dump/pg_backup_custom.c
View file @
fc5c577e
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
2 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
3 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -179,7 +179,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file %s: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
}
else
{
...
...
@@ -190,7 +190,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
if
(
!
AH
->
FH
)
die_horribly
(
AH
,
modulename
,
"could not open archive file %s: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ReadHead
(
AH
);
ReadToc
(
AH
);
...
...
src/bin/pg_dump/pg_backup_files.c
View file @
fc5c577e
...
...
@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
0 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.2
1 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -129,7 +129,7 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
if
(
AH
->
FH
==
NULL
)
die_horribly
(
NULL
,
modulename
,
"could not open output file: %s
\n
"
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
if
(
AH
->
compression
<
0
||
AH
->
compression
>
9
)
AH
->
compression
=
Z_DEFAULT_COMPRESSION
;
...
...
@@ -147,7 +147,7 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
if
(
AH
->
FH
==
NULL
)
die_horribly
(
NULL
,
modulename
,
"could not open input file: %s
\n
"
,
strerror
(
errno
));
ctx
->
hasSeek
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
AH
->
FH
);
ReadHead
(
AH
);
ReadToc
(
AH
);
...
...
src/bin/pg_dump/pg_backup_tar.c
View file @
fc5c577e
...
...
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
1 2002/10/22 19:15:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
2 2002/10/25 01:33:17
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -190,7 +190,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
*/
/* setvbuf(ctx->tarFH, NULL, _IONBF, 0); */
ctx
->
hasSeek
=
(
fseeko
(
ctx
->
tarFH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
ctx
->
tarFH
);
if
(
AH
->
compression
<
0
||
AH
->
compression
>
9
)
AH
->
compression
=
Z_DEFAULT_COMPRESSION
;
...
...
@@ -227,7 +227,7 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
ctx
->
tarFHpos
=
0
;
ctx
->
hasSeek
=
(
fseeko
(
ctx
->
tarFH
,
0
,
SEEK_CUR
)
==
0
);
ctx
->
hasSeek
=
checkSeek
(
ctx
->
tarFH
);
/*
* Forcibly unmark the header as read since we use the lookahead
...
...
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