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
2b287020
Commit
2b287020
authored
Oct 22, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 8-byte off_t to properly pg_dump, from Philip Warner with mods by Bruce.
parent
19cc7bcb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
154 additions
and
87 deletions
+154
-87
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+107
-7
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+13
-3
src/bin/pg_dump/pg_backup_custom.c
src/bin/pg_dump/pg_backup_custom.c
+29
-50
src/bin/pg_dump/pg_backup_db.c
src/bin/pg_dump/pg_backup_db.c
+2
-9
src/bin/pg_dump/pg_backup_files.c
src/bin/pg_dump/pg_backup_files.c
+1
-5
src/bin/pg_dump/pg_backup_tar.c
src/bin/pg_dump/pg_backup_tar.c
+1
-9
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+1
-4
No files found.
src/bin/pg_dump/pg_backup_archiver.c
View file @
2b287020
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.5
8 2002/10/16 05:46:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.5
9 2002/10/22 19:15:23
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -671,9 +671,11 @@ PrintTOCSummary(Archive *AHX, RestoreOptions *ropt)
...
@@ -671,9 +671,11 @@ PrintTOCSummary(Archive *AHX, RestoreOptions *ropt)
}
}
ahprintf
(
AH
,
"; Dump Version: %d.%d-%d
\n
"
,
AH
->
vmaj
,
AH
->
vmin
,
AH
->
vrev
);
ahprintf
(
AH
,
"; Dump Version: %d.%d-%d
\n
"
,
AH
->
vmaj
,
AH
->
vmin
,
AH
->
vrev
);
ahprintf
(
AH
,
"; Format: %s
\n
;
\n
"
,
fmtName
);
ahprintf
(
AH
,
"; Format: %s
\n
"
,
fmtName
);
ahprintf
(
AH
,
"; Integer: %d bytes
\n
"
,
AH
->
intSize
);
ahprintf
(
AH
,
"; Offset: %d bytes
\n
"
,
AH
->
offSize
);
ahprintf
(
AH
,
";
\n
; Selected TOC Entries:
\n
;
\n
"
);
ahprintf
(
AH
,
";
\n
;
\n
;
Selected TOC Entries:
\n
;
\n
"
);
while
(
te
!=
AH
->
toc
)
while
(
te
!=
AH
->
toc
)
{
{
...
@@ -1368,6 +1370,87 @@ TocIDRequired(ArchiveHandle *AH, int id, RestoreOptions *ropt)
...
@@ -1368,6 +1370,87 @@ TocIDRequired(ArchiveHandle *AH, int id, RestoreOptions *ropt)
return
_tocEntryRequired
(
te
,
ropt
);
return
_tocEntryRequired
(
te
,
ropt
);
}
}
size_t
WriteOffset
(
ArchiveHandle
*
AH
,
off_t
o
,
int
wasSet
)
{
int
off
;
/* Save the flag */
(
*
AH
->
WriteBytePtr
)
(
AH
,
wasSet
);
/* Write out off_t smallest byte first, prevents endian mismatch */
for
(
off
=
0
;
off
<
sizeof
(
off_t
);
off
++
)
{
(
*
AH
->
WriteBytePtr
)
(
AH
,
o
&
0xFF
);
o
>>=
8
;
}
return
sizeof
(
off_t
)
+
1
;
}
int
ReadOffset
(
ArchiveHandle
*
AH
,
off_t
*
o
)
{
int
i
;
int
off
;
int
offsetFlg
;
/* Initialize to zero */
*
o
=
0
;
/* Check for old version */
if
(
AH
->
version
<
K_VERS_1_7
)
{
/* Prior versions wrote offsets using WriteInt */
i
=
ReadInt
(
AH
);
/* -1 means not set */
if
(
i
<
0
)
return
K_OFFSET_POS_NOT_SET
;
else
if
(
i
==
0
)
return
K_OFFSET_NO_DATA
;
/* Cast to off_t because it was written as an int. */
*
o
=
(
off_t
)
i
;
return
K_OFFSET_POS_SET
;
}
/*
* Read the flag indicating the state of the data pointer.
* Check if valid and die if not.
*
* This used to be handled by a negative or zero pointer,
* now we use an extra byte specifically for the state.
*/
offsetFlg
=
(
*
AH
->
ReadBytePtr
)
(
AH
)
&
0xFF
;
switch
(
offsetFlg
)
{
case
K_OFFSET_POS_NOT_SET
:
case
K_OFFSET_NO_DATA
:
case
K_OFFSET_POS_SET
:
break
;
default:
die_horribly
(
AH
,
modulename
,
"Unexpected data offset flag %d
\n
"
,
offsetFlg
);
}
/*
* Read the bytes
*/
for
(
off
=
0
;
off
<
AH
->
offSize
;
off
++
)
{
if
(
off
<
sizeof
(
off_t
))
*
o
|=
((
*
AH
->
ReadBytePtr
)
(
AH
))
<<
(
off
*
8
);
else
{
if
((
*
AH
->
ReadBytePtr
)
(
AH
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"file offset in dump file is too large
\n
"
);
}
}
return
offsetFlg
;
}
size_t
size_t
WriteInt
(
ArchiveHandle
*
AH
,
int
i
)
WriteInt
(
ArchiveHandle
*
AH
,
int
i
)
{
{
...
@@ -1528,14 +1611,22 @@ _discoverArchiveFormat(ArchiveHandle *AH)
...
@@ -1528,14 +1611,22 @@ _discoverArchiveFormat(ArchiveHandle *AH)
else
else
AH
->
vrev
=
0
;
AH
->
vrev
=
0
;
/* Make a convenient integer <maj><min><rev>00 */
AH
->
version
=
((
AH
->
vmaj
*
256
+
AH
->
vmin
)
*
256
+
AH
->
vrev
)
*
256
+
0
;
AH
->
intSize
=
fgetc
(
fh
);
AH
->
intSize
=
fgetc
(
fh
);
AH
->
lookahead
[
AH
->
lookaheadLen
++
]
=
AH
->
intSize
;
AH
->
lookahead
[
AH
->
lookaheadLen
++
]
=
AH
->
intSize
;
if
(
AH
->
version
>=
K_VERS_1_7
)
{
AH
->
offSize
=
fgetc
(
fh
);
AH
->
lookahead
[
AH
->
lookaheadLen
++
]
=
AH
->
offSize
;
}
else
AH
->
offSize
=
AH
->
intSize
;
AH
->
format
=
fgetc
(
fh
);
AH
->
format
=
fgetc
(
fh
);
AH
->
lookahead
[
AH
->
lookaheadLen
++
]
=
AH
->
format
;
AH
->
lookahead
[
AH
->
lookaheadLen
++
]
=
AH
->
format
;
/* Make a convenient integer <maj><min><rev>00 */
AH
->
version
=
((
AH
->
vmaj
*
256
+
AH
->
vmin
)
*
256
+
AH
->
vrev
)
*
256
+
0
;
}
}
else
else
{
{
...
@@ -1599,6 +1690,8 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
...
@@ -1599,6 +1690,8 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
if
(
!
AH
)
if
(
!
AH
)
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
die_horribly
(
AH
,
modulename
,
"out of memory
\n
"
);
/* AH->debugLevel = 100; */
AH
->
vmaj
=
K_VERS_MAJOR
;
AH
->
vmaj
=
K_VERS_MAJOR
;
AH
->
vmin
=
K_VERS_MINOR
;
AH
->
vmin
=
K_VERS_MINOR
;
AH
->
vrev
=
K_VERS_REV
;
AH
->
vrev
=
K_VERS_REV
;
...
@@ -1606,6 +1699,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
...
@@ -1606,6 +1699,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
AH
->
createDate
=
time
(
NULL
);
AH
->
createDate
=
time
(
NULL
);
AH
->
intSize
=
sizeof
(
int
);
AH
->
intSize
=
sizeof
(
int
);
AH
->
offSize
=
sizeof
(
off_t
);
AH
->
lastID
=
0
;
AH
->
lastID
=
0
;
if
(
FileSpec
)
if
(
FileSpec
)
{
{
...
@@ -1784,7 +1878,7 @@ ReadToc(ArchiveHandle *AH)
...
@@ -1784,7 +1878,7 @@ ReadToc(ArchiveHandle *AH)
/* Sanity check */
/* Sanity check */
if
(
te
->
id
<=
0
||
te
->
id
>
AH
->
tocCount
)
if
(
te
->
id
<=
0
||
te
->
id
>
AH
->
tocCount
)
die_horribly
(
AH
,
modulename
,
"entry id
out of range - perhaps a corrupt TOC
\n
"
);
die_horribly
(
AH
,
modulename
,
"entry id
%d out of range - perhaps a corrupt TOC
\n
"
,
te
->
id
);
te
->
hadDumper
=
ReadInt
(
AH
);
te
->
hadDumper
=
ReadInt
(
AH
);
te
->
oid
=
ReadStr
(
AH
);
te
->
oid
=
ReadStr
(
AH
);
...
@@ -2133,6 +2227,7 @@ WriteHead(ArchiveHandle *AH)
...
@@ -2133,6 +2227,7 @@ WriteHead(ArchiveHandle *AH)
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
vmin
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
vmin
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
vrev
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
vrev
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
intSize
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
intSize
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
offSize
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
format
);
(
*
AH
->
WriteBytePtr
)
(
AH
,
AH
->
format
);
#ifndef HAVE_LIBZ
#ifndef HAVE_LIBZ
...
@@ -2195,6 +2290,11 @@ ReadHead(ArchiveHandle *AH)
...
@@ -2195,6 +2290,11 @@ ReadHead(ArchiveHandle *AH)
if
(
AH
->
intSize
>
sizeof
(
int
))
if
(
AH
->
intSize
>
sizeof
(
int
))
write_msg
(
modulename
,
"WARNING: archive was made on a machine with larger integers, some operations may fail
\n
"
);
write_msg
(
modulename
,
"WARNING: archive was made on a machine with larger integers, some operations may fail
\n
"
);
if
(
AH
->
version
>=
K_VERS_1_7
)
AH
->
offSize
=
(
*
AH
->
ReadBytePtr
)
(
AH
);
else
AH
->
offSize
=
AH
->
intSize
;
fmt
=
(
*
AH
->
ReadBytePtr
)
(
AH
);
fmt
=
(
*
AH
->
ReadBytePtr
)
(
AH
);
if
(
AH
->
format
!=
fmt
)
if
(
AH
->
format
!=
fmt
)
...
...
src/bin/pg_dump/pg_backup_archiver.h
View file @
2b287020
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
7 2002/09/04 20:31:34
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.4
8 2002/10/22 19:15:23
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -58,7 +58,7 @@ typedef z_stream *z_streamp;
...
@@ -58,7 +58,7 @@ typedef z_stream *z_streamp;
#include "libpq-fe.h"
#include "libpq-fe.h"
#define K_VERS_MAJOR 1
#define K_VERS_MAJOR 1
#define K_VERS_MINOR
6
#define K_VERS_MINOR
7
#define K_VERS_REV 0
#define K_VERS_REV 0
/* Data block types */
/* Data block types */
...
@@ -73,11 +73,17 @@ typedef z_stream *z_streamp;
...
@@ -73,11 +73,17 @@ typedef z_stream *z_streamp;
#define K_VERS_1_4 (( (1 * 256 + 4) * 256 + 0) * 256 + 0)
/* Date & name in header */
#define K_VERS_1_4 (( (1 * 256 + 4) * 256 + 0) * 256 + 0)
/* Date & name in header */
#define K_VERS_1_5 (( (1 * 256 + 5) * 256 + 0) * 256 + 0)
/* Handle dependencies */
#define K_VERS_1_5 (( (1 * 256 + 5) * 256 + 0) * 256 + 0)
/* Handle dependencies */
#define K_VERS_1_6 (( (1 * 256 + 6) * 256 + 0) * 256 + 0)
/* Schema field in TOCs */
#define K_VERS_1_6 (( (1 * 256 + 6) * 256 + 0) * 256 + 0)
/* Schema field in TOCs */
#define K_VERS_MAX (( (1 * 256 + 6) * 256 + 255) * 256 + 0)
#define K_VERS_1_7 (( (1 * 256 + 7) * 256 + 0) * 256 + 0)
/* File Offset size in header */
#define K_VERS_MAX (( (1 * 256 + 7) * 256 + 255) * 256 + 0)
/* No of BLOBs to restore in 1 TX */
/* No of BLOBs to restore in 1 TX */
#define BLOB_BATCH_SIZE 100
#define BLOB_BATCH_SIZE 100
/* Flags to indicate disposition of offsets stored in files */
#define K_OFFSET_POS_NOT_SET 1
#define K_OFFSET_POS_SET 2
#define K_OFFSET_NO_DATA 3
struct
_archiveHandle
;
struct
_archiveHandle
;
struct
_tocEntry
;
struct
_tocEntry
;
struct
_restoreList
;
struct
_restoreList
;
...
@@ -148,6 +154,7 @@ typedef struct _archiveHandle
...
@@ -148,6 +154,7 @@ typedef struct _archiveHandle
int
debugLevel
;
/* Used for logging (currently only by
int
debugLevel
;
/* Used for logging (currently only by
* --verbose) */
* --verbose) */
size_t
intSize
;
/* Size of an integer in the archive */
size_t
intSize
;
/* Size of an integer in the archive */
size_t
offSize
;
/* Size of a file offset in the archive - Added V1.7 */
ArchiveFormat
format
;
/* Archive format */
ArchiveFormat
format
;
/* Archive format */
sqlparseInfo
sqlparse
;
sqlparseInfo
sqlparse
;
...
@@ -287,6 +294,9 @@ extern int ReadInt(ArchiveHandle *AH);
...
@@ -287,6 +294,9 @@ extern int ReadInt(ArchiveHandle *AH);
extern
char
*
ReadStr
(
ArchiveHandle
*
AH
);
extern
char
*
ReadStr
(
ArchiveHandle
*
AH
);
extern
size_t
WriteStr
(
ArchiveHandle
*
AH
,
const
char
*
s
);
extern
size_t
WriteStr
(
ArchiveHandle
*
AH
,
const
char
*
s
);
int
ReadOffset
(
ArchiveHandle
*
,
off_t
*
);
size_t
WriteOffset
(
ArchiveHandle
*
,
off_t
,
int
);
extern
void
StartRestoreBlobs
(
ArchiveHandle
*
AH
);
extern
void
StartRestoreBlobs
(
ArchiveHandle
*
AH
);
extern
void
StartRestoreBlob
(
ArchiveHandle
*
AH
,
Oid
oid
);
extern
void
StartRestoreBlob
(
ArchiveHandle
*
AH
,
Oid
oid
);
extern
void
EndRestoreBlob
(
ArchiveHandle
*
AH
,
Oid
oid
);
extern
void
EndRestoreBlob
(
ArchiveHandle
*
AH
,
Oid
oid
);
...
...
src/bin/pg_dump/pg_backup_custom.c
View file @
2b287020
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
1 2002/09/04 20:31:34
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.2
2 2002/10/22 19:15:23
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -79,8 +79,8 @@ typedef struct
...
@@ -79,8 +79,8 @@ typedef struct
typedef
struct
typedef
struct
{
{
int
dataState
;
off_t
dataPos
;
off_t
dataPos
;
size_t
dataLen
;
}
lclTocEntry
;
}
lclTocEntry
;
...
@@ -171,7 +171,6 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
...
@@ -171,7 +171,6 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
*/
*/
if
(
AH
->
mode
==
archModeWrite
)
if
(
AH
->
mode
==
archModeWrite
)
{
{
if
(
AH
->
fSpec
&&
strcmp
(
AH
->
fSpec
,
""
)
!=
0
)
if
(
AH
->
fSpec
&&
strcmp
(
AH
->
fSpec
,
""
)
!=
0
)
AH
->
FH
=
fopen
(
AH
->
fSpec
,
PG_BINARY_W
);
AH
->
FH
=
fopen
(
AH
->
fSpec
,
PG_BINARY_W
);
else
else
...
@@ -181,11 +180,9 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
...
@@ -181,11 +180,9 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
die_horribly
(
AH
,
modulename
,
"could not open archive file %s: %s
\n
"
,
AH
->
fSpec
,
strerror
(
errno
));
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
=
(
fseeko
(
AH
->
FH
,
0
,
SEEK_CUR
)
==
0
);
}
}
else
else
{
{
if
(
AH
->
fSpec
&&
strcmp
(
AH
->
fSpec
,
""
)
!=
0
)
if
(
AH
->
fSpec
&&
strcmp
(
AH
->
fSpec
,
""
)
!=
0
)
AH
->
FH
=
fopen
(
AH
->
fSpec
,
PG_BINARY_R
);
AH
->
FH
=
fopen
(
AH
->
fSpec
,
PG_BINARY_R
);
else
else
...
@@ -216,12 +213,11 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te)
...
@@ -216,12 +213,11 @@ _ArchiveEntry(ArchiveHandle *AH, TocEntry *te)
ctx
=
(
lclTocEntry
*
)
calloc
(
1
,
sizeof
(
lclTocEntry
));
ctx
=
(
lclTocEntry
*
)
calloc
(
1
,
sizeof
(
lclTocEntry
));
if
(
te
->
dataDumper
)
if
(
te
->
dataDumper
)
ctx
->
data
Pos
=
-
1
;
ctx
->
data
State
=
K_OFFSET_POS_NOT_SET
;
else
else
ctx
->
dataPos
=
0
;
ctx
->
dataState
=
K_OFFSET_NO_DATA
;
ctx
->
dataLen
=
0
;
te
->
formatData
=
(
void
*
)
ctx
;
te
->
formatData
=
(
void
*
)
ctx
;
}
}
/*
/*
...
@@ -238,8 +234,7 @@ _WriteExtraToc(ArchiveHandle *AH, TocEntry *te)
...
@@ -238,8 +234,7 @@ _WriteExtraToc(ArchiveHandle *AH, TocEntry *te)
{
{
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
WriteInt
(
AH
,
ctx
->
dataPos
);
WriteOffset
(
AH
,
ctx
->
dataPos
,
ctx
->
dataState
);
WriteInt
(
AH
,
ctx
->
dataLen
);
}
}
/*
/*
...
@@ -253,6 +248,7 @@ _WriteExtraToc(ArchiveHandle *AH, TocEntry *te)
...
@@ -253,6 +248,7 @@ _WriteExtraToc(ArchiveHandle *AH, TocEntry *te)
static
void
static
void
_ReadExtraToc
(
ArchiveHandle
*
AH
,
TocEntry
*
te
)
_ReadExtraToc
(
ArchiveHandle
*
AH
,
TocEntry
*
te
)
{
{
int
junk
;
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
if
(
ctx
==
NULL
)
if
(
ctx
==
NULL
)
...
@@ -261,8 +257,14 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te)
...
@@ -261,8 +257,14 @@ _ReadExtraToc(ArchiveHandle *AH, TocEntry *te)
te
->
formatData
=
(
void
*
)
ctx
;
te
->
formatData
=
(
void
*
)
ctx
;
}
}
ctx
->
dataPos
=
ReadInt
(
AH
);
ctx
->
dataState
=
ReadOffset
(
AH
,
&
(
ctx
->
dataPos
)
);
ctx
->
dataLen
=
ReadInt
(
AH
);
/*
* Prior to V1.7 (pg7.3), we dumped the data size as an int
* now we don't dump it at all.
*/
if
(
AH
->
version
<
K_VERS_1_7
)
junk
=
ReadInt
(
AH
);
}
}
/*
/*
...
@@ -277,8 +279,8 @@ _PrintExtraToc(ArchiveHandle *AH, TocEntry *te)
...
@@ -277,8 +279,8 @@ _PrintExtraToc(ArchiveHandle *AH, TocEntry *te)
{
{
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
lclTocEntry
*
ctx
=
(
lclTocEntry
*
)
te
->
formatData
;
ahprintf
(
AH
,
"-- Data Pos: "
INT64_FORMAT
"
(Length %lu)
\n
"
,
ahprintf
(
AH
,
"-- Data Pos: "
INT64_FORMAT
"
\n
"
,
(
int64
)
ctx
->
dataPos
,
(
unsigned
long
)
ctx
->
dataLen
);
(
int64
)
ctx
->
dataPos
);
}
}
/*
/*
...
@@ -298,12 +300,12 @@ _StartData(ArchiveHandle *AH, TocEntry *te)
...
@@ -298,12 +300,12 @@ _StartData(ArchiveHandle *AH, TocEntry *te)
lclTocEntry
*
tctx
=
(
lclTocEntry
*
)
te
->
formatData
;
lclTocEntry
*
tctx
=
(
lclTocEntry
*
)
te
->
formatData
;
tctx
->
dataPos
=
_getFilePos
(
AH
,
ctx
);
tctx
->
dataPos
=
_getFilePos
(
AH
,
ctx
);
tctx
->
dataState
=
K_OFFSET_POS_SET
;
_WriteByte
(
AH
,
BLK_DATA
);
/* Block type */
_WriteByte
(
AH
,
BLK_DATA
);
/* Block type */
WriteInt
(
AH
,
te
->
id
);
/* For sanity check */
WriteInt
(
AH
,
te
->
id
);
/* For sanity check */
_StartDataCompressor
(
AH
,
te
);
_StartDataCompressor
(
AH
,
te
);
}
}
/*
/*
...
@@ -343,12 +345,10 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
...
@@ -343,12 +345,10 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen)
static
void
static
void
_EndData
(
ArchiveHandle
*
AH
,
TocEntry
*
te
)
_EndData
(
ArchiveHandle
*
AH
,
TocEntry
*
te
)
{
{
lclContext
*
ctx
=
(
lclContext
*
)
AH
->
formatData
;
/* lclContext *ctx = (lclContext *) AH->formatData; */
lclTocEntry
*
tctx
=
(
lclTocEntry
*
)
te
->
formatData
;
/* lclTocEntry *tctx = (lclTocEntry *) te->formatData; */
_EndDataCompressor
(
AH
,
te
);
_EndDataCompressor
(
AH
,
te
);
tctx
->
dataLen
=
_getFilePos
(
AH
,
ctx
)
-
tctx
->
dataPos
;
}
}
/*
/*
...
@@ -368,10 +368,10 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
...
@@ -368,10 +368,10 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
lclTocEntry
*
tctx
=
(
lclTocEntry
*
)
te
->
formatData
;
lclTocEntry
*
tctx
=
(
lclTocEntry
*
)
te
->
formatData
;
tctx
->
dataPos
=
_getFilePos
(
AH
,
ctx
);
tctx
->
dataPos
=
_getFilePos
(
AH
,
ctx
);
tctx
->
dataState
=
K_OFFSET_POS_SET
;
_WriteByte
(
AH
,
BLK_BLOBS
);
/* Block type */
_WriteByte
(
AH
,
BLK_BLOBS
);
/* Block type */
WriteInt
(
AH
,
te
->
id
);
/* For sanity check */
WriteInt
(
AH
,
te
->
id
);
/* For sanity check */
}
}
/*
/*
...
@@ -428,12 +428,11 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -428,12 +428,11 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
int
blkType
;
int
blkType
;
int
found
=
0
;
int
found
=
0
;
if
(
tctx
->
data
Pos
==
0
)
if
(
tctx
->
data
State
==
K_OFFSET_NO_DATA
)
return
;
return
;
if
(
!
ctx
->
hasSeek
||
tctx
->
data
Pos
<
0
)
if
(
!
ctx
->
hasSeek
||
tctx
->
data
State
==
K_OFFSET_POS_NOT_SET
)
{
{
/* Skip over unnecessary blocks until we get the one we want. */
/* Skip over unnecessary blocks until we get the one we want. */
found
=
0
;
found
=
0
;
...
@@ -442,7 +441,6 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -442,7 +441,6 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
while
(
id
!=
te
->
id
)
while
(
id
!=
te
->
id
)
{
{
if
((
TocIDRequired
(
AH
,
id
,
ropt
)
&
2
)
!=
0
)
if
((
TocIDRequired
(
AH
,
id
,
ropt
)
&
2
)
!=
0
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"Dumping a specific TOC data block out of order is not supported"
"Dumping a specific TOC data block out of order is not supported"
...
@@ -450,40 +448,30 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -450,40 +448,30 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
switch
(
blkType
)
switch
(
blkType
)
{
{
case
BLK_DATA
:
case
BLK_DATA
:
_skipData
(
AH
);
_skipData
(
AH
);
break
;
break
;
case
BLK_BLOBS
:
case
BLK_BLOBS
:
_skipBlobs
(
AH
);
_skipBlobs
(
AH
);
break
;
break
;
default:
/* Always have a default */
default:
/* Always have a default */
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"unrecognized data block type (%d) while searching archive
\n
"
,
"unrecognized data block type (%d) while searching archive
\n
"
,
blkType
);
blkType
);
break
;
break
;
}
}
_readBlockHeader
(
AH
,
&
blkType
,
&
id
);
_readBlockHeader
(
AH
,
&
blkType
,
&
id
);
}
}
}
}
else
else
{
{
/* Grab it */
/* Grab it */
if
(
fseeko
(
AH
->
FH
,
tctx
->
dataPos
,
SEEK_SET
)
!=
0
)
if
(
fseeko
(
AH
->
FH
,
tctx
->
dataPos
,
SEEK_SET
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"error during file seek: %s
\n
"
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"error during file seek: %s
\n
"
,
strerror
(
errno
));
_readBlockHeader
(
AH
,
&
blkType
,
&
id
);
_readBlockHeader
(
AH
,
&
blkType
,
&
id
);
}
}
/* Are we sane? */
/* Are we sane? */
...
@@ -493,14 +481,11 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -493,14 +481,11 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
switch
(
blkType
)
switch
(
blkType
)
{
{
case
BLK_DATA
:
case
BLK_DATA
:
_PrintData
(
AH
);
_PrintData
(
AH
);
break
;
break
;
case
BLK_BLOBS
:
case
BLK_BLOBS
:
if
(
!
AH
->
connection
)
if
(
!
AH
->
connection
)
die_horribly
(
AH
,
modulename
,
"large objects cannot be loaded without a database connection
\n
"
);
die_horribly
(
AH
,
modulename
,
"large objects cannot be loaded without a database connection
\n
"
);
...
@@ -508,7 +493,6 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
...
@@ -508,7 +493,6 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
break
;
break
;
default:
/* Always have a default */
default:
/* Always have a default */
die_horribly
(
AH
,
modulename
,
"unrecognized data block type %d while restoring archive
\n
"
,
die_horribly
(
AH
,
modulename
,
"unrecognized data block type %d while restoring archive
\n
"
,
blkType
);
blkType
);
break
;
break
;
...
@@ -579,7 +563,6 @@ _PrintData(ArchiveHandle *AH)
...
@@ -579,7 +563,6 @@ _PrintData(ArchiveHandle *AH)
if
(
AH
->
compression
!=
0
)
if
(
AH
->
compression
!=
0
)
{
{
while
(
zp
->
avail_in
!=
0
)
while
(
zp
->
avail_in
!=
0
)
{
{
zp
->
next_out
=
out
;
zp
->
next_out
=
out
;
...
@@ -602,9 +585,7 @@ _PrintData(ArchiveHandle *AH)
...
@@ -602,9 +585,7 @@ _PrintData(ArchiveHandle *AH)
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBZ
}
}
#endif
#endif
blkLen
=
ReadInt
(
AH
);
blkLen
=
ReadInt
(
AH
);
}
}
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBZ
...
@@ -627,7 +608,6 @@ _PrintData(ArchiveHandle *AH)
...
@@ -627,7 +608,6 @@ _PrintData(ArchiveHandle *AH)
die_horribly
(
AH
,
modulename
,
"could not close compression library: %s
\n
"
,
zp
->
msg
);
die_horribly
(
AH
,
modulename
,
"could not close compression library: %s
\n
"
,
zp
->
msg
);
}
}
#endif
#endif
}
}
static
void
static
void
...
@@ -647,7 +627,6 @@ _LoadBlobs(ArchiveHandle *AH)
...
@@ -647,7 +627,6 @@ _LoadBlobs(ArchiveHandle *AH)
}
}
EndRestoreBlobs
(
AH
);
EndRestoreBlobs
(
AH
);
}
}
/*
/*
...
@@ -702,7 +681,6 @@ _skipData(ArchiveHandle *AH)
...
@@ -702,7 +681,6 @@ _skipData(ArchiveHandle *AH)
blkLen
=
ReadInt
(
AH
);
blkLen
=
ReadInt
(
AH
);
}
}
}
}
/*
/*
...
@@ -862,8 +840,12 @@ _getFilePos(ArchiveHandle *AH, lclContext *ctx)
...
@@ -862,8 +840,12 @@ _getFilePos(ArchiveHandle *AH, lclContext *ctx)
pos
=
ftello
(
AH
->
FH
);
pos
=
ftello
(
AH
->
FH
);
if
(
pos
!=
ctx
->
filePos
)
if
(
pos
!=
ctx
->
filePos
)
{
{
write_msg
(
modulename
,
"WARNING: ftell mismatch with expected position -- ftell ignored
\n
"
);
write_msg
(
modulename
,
"WARNING: ftell mismatch with expected position -- ftell used
\n
"
);
pos
=
ctx
->
filePos
;
/*
* Prior to 1.7 (pg7.3) we relied on the internally maintained pointer.
* Now we rely on off_t always.
* pos = ctx->filePos;
*/
}
}
}
}
else
else
...
@@ -986,8 +968,6 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
...
@@ -986,8 +968,6 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
res
=
Z_STREAM_END
;
res
=
Z_STREAM_END
;
#endif
#endif
}
}
}
}
#ifdef HAVE_LIBZ
#ifdef HAVE_LIBZ
...
@@ -995,7 +975,6 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
...
@@ -995,7 +975,6 @@ _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush)
#else
#else
return
1
;
return
1
;
#endif
#endif
}
}
/*
/*
...
...
src/bin/pg_dump/pg_backup_db.c
View file @
2b287020
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
* Implements the basic DB functions used by the archiver.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.4
2 2002/10/16 05:46:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.4
3 2002/10/22 19:15:23
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -65,7 +65,7 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
...
@@ -65,7 +65,7 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
* Autocommit could be off. We turn it off later but we have to check
* Autocommit could be off. We turn it off later but we have to check
* the database version first.
* the database version first.
*/
*/
res
=
PQexec
(
conn
,
"BEGIN;SELECT version();"
);
res
=
PQexec
(
conn
,
"BEGIN;SELECT version();"
);
if
(
!
res
||
if
(
!
res
||
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
||
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
||
...
@@ -208,7 +208,6 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
...
@@ -208,7 +208,6 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
die_horribly
(
AH
,
modulename
,
"could not reconnect to database: %s"
,
die_horribly
(
AH
,
modulename
,
"could not reconnect to database: %s"
,
PQerrorMessage
(
newConn
));
PQerrorMessage
(
newConn
));
}
}
}
while
(
need_pass
);
}
while
(
need_pass
);
if
(
password
)
if
(
password
)
...
@@ -469,7 +468,6 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
...
@@ -469,7 +468,6 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
{
{
case
SQL_SCAN
:
/* Default state == 0, set in _allocAH */
case
SQL_SCAN
:
/* Default state == 0, set in _allocAH */
if
(
qry
[
pos
]
==
';'
&&
AH
->
sqlparse
.
braceDepth
==
0
)
if
(
qry
[
pos
]
==
';'
&&
AH
->
sqlparse
.
braceDepth
==
0
)
{
{
/* Send It & reset the buffer */
/* Send It & reset the buffer */
...
@@ -512,23 +510,19 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
...
@@ -512,23 +510,19 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
AH
->
sqlparse
.
lastChar
=
qry
[
pos
];
AH
->
sqlparse
.
lastChar
=
qry
[
pos
];
}
}
break
;
break
;
case
SQL_IN_SQL_COMMENT
:
case
SQL_IN_SQL_COMMENT
:
if
(
qry
[
pos
]
==
'\n'
)
if
(
qry
[
pos
]
==
'\n'
)
AH
->
sqlparse
.
state
=
SQL_SCAN
;
AH
->
sqlparse
.
state
=
SQL_SCAN
;
break
;
break
;
case
SQL_IN_EXT_COMMENT
:
case
SQL_IN_EXT_COMMENT
:
if
(
AH
->
sqlparse
.
lastChar
==
'*'
&&
qry
[
pos
]
==
'/'
)
if
(
AH
->
sqlparse
.
lastChar
==
'*'
&&
qry
[
pos
]
==
'/'
)
AH
->
sqlparse
.
state
=
SQL_SCAN
;
AH
->
sqlparse
.
state
=
SQL_SCAN
;
break
;
break
;
case
SQL_IN_QUOTE
:
case
SQL_IN_QUOTE
:
if
(
!
AH
->
sqlparse
.
backSlash
&&
AH
->
sqlparse
.
quoteChar
==
qry
[
pos
])
if
(
!
AH
->
sqlparse
.
backSlash
&&
AH
->
sqlparse
.
quoteChar
==
qry
[
pos
])
{
{
/* fprintf(stderr,"[endquote]\n"); */
/* fprintf(stderr,"[endquote]\n"); */
...
@@ -559,7 +553,6 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
...
@@ -559,7 +553,6 @@ _sendSQLLine(ArchiveHandle *AH, char *qry, char *eos)
* stmt
* stmt
*/
*/
return
eos
;
return
eos
;
}
}
...
...
src/bin/pg_dump/pg_backup_files.c
View file @
2b287020
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.
19 2002/09/10 18:25:13 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.
20 2002/10/22 19:15:23 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -155,7 +155,6 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
...
@@ -155,7 +155,6 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
if
(
fclose
(
AH
->
FH
)
!=
0
)
if
(
fclose
(
AH
->
FH
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"could not close TOC file: %s
\n
"
,
strerror
(
errno
));
die_horribly
(
AH
,
modulename
,
"could not close TOC file: %s
\n
"
,
strerror
(
errno
));
}
}
}
}
/*
/*
...
@@ -244,7 +243,6 @@ _StartData(ArchiveHandle *AH, TocEntry *te)
...
@@ -244,7 +243,6 @@ _StartData(ArchiveHandle *AH, TocEntry *te)
if
(
tctx
->
FH
==
NULL
)
if
(
tctx
->
FH
==
NULL
)
die_horribly
(
AH
,
modulename
,
"could not open data file for output
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not open data file for output
\n
"
);
}
}
static
size_t
static
size_t
...
@@ -298,7 +296,6 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
...
@@ -298,7 +296,6 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
if
(
GZCLOSE
(
AH
->
FH
)
!=
0
)
if
(
GZCLOSE
(
AH
->
FH
)
!=
0
)
die_horribly
(
AH
,
modulename
,
"could not close data file after reading
\n
"
);
die_horribly
(
AH
,
modulename
,
"could not close data file after reading
\n
"
);
}
}
...
@@ -473,7 +470,6 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
...
@@ -473,7 +470,6 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
if
(
ctx
->
blobToc
==
NULL
)
if
(
ctx
->
blobToc
==
NULL
)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"could not open large object TOC for output: %s
\n
"
,
strerror
(
errno
));
"could not open large object TOC for output: %s
\n
"
,
strerror
(
errno
));
}
}
/*
/*
...
...
src/bin/pg_dump/pg_backup_tar.c
View file @
2b287020
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
0 2002/09/10 18:22:20 tgl
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.3
1 2002/10/22 19:15:23 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -240,7 +240,6 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
...
@@ -240,7 +240,6 @@ InitArchiveFmt_Tar(ArchiveHandle *AH)
ReadToc
(
AH
);
ReadToc
(
AH
);
tarClose
(
AH
,
ctx
->
FH
);
/* Nothing else in the file... */
tarClose
(
AH
,
ctx
->
FH
);
/* Nothing else in the file... */
}
}
}
}
/*
/*
...
@@ -354,7 +353,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
...
@@ -354,7 +353,6 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
/* tm->zFH = gzdopen(dup(fileno(ctx->tarFH)), "rb"); */
/* tm->zFH = gzdopen(dup(fileno(ctx->tarFH)), "rb"); */
#else
#else
tm
->
nFH
=
ctx
->
tarFH
;
tm
->
nFH
=
ctx
->
tarFH
;
#endif
#endif
...
@@ -708,9 +706,7 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
...
@@ -708,9 +706,7 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
th
=
tarOpen
(
AH
,
NULL
,
'r'
);
th
=
tarOpen
(
AH
,
NULL
,
'r'
);
}
}
EndRestoreBlobs
(
AH
);
EndRestoreBlobs
(
AH
);
}
}
...
@@ -832,7 +828,6 @@ _CloseArchive(ArchiveHandle *AH)
...
@@ -832,7 +828,6 @@ _CloseArchive(ArchiveHandle *AH)
die_horribly
(
AH
,
modulename
,
die_horribly
(
AH
,
modulename
,
"could not write null block at end of tar archive
\n
"
);
"could not write null block at end of tar archive
\n
"
);
}
}
}
}
AH
->
FH
=
NULL
;
AH
->
FH
=
NULL
;
...
@@ -868,7 +863,6 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
...
@@ -868,7 +863,6 @@ _StartBlobs(ArchiveHandle *AH, TocEntry *te)
sprintf
(
fname
,
"blobs.toc"
);
sprintf
(
fname
,
"blobs.toc"
);
ctx
->
blobToc
=
tarOpen
(
AH
,
fname
,
'w'
);
ctx
->
blobToc
=
tarOpen
(
AH
,
fname
,
'w'
);
}
}
/*
/*
...
@@ -899,7 +893,6 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid)
...
@@ -899,7 +893,6 @@ _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid)
tarPrintf
(
AH
,
ctx
->
blobToc
,
"%u %s
\n
"
,
oid
,
fname
);
tarPrintf
(
AH
,
ctx
->
blobToc
,
"%u %s
\n
"
,
oid
,
fname
);
tctx
->
TH
=
tarOpen
(
AH
,
fname
,
'w'
);
tctx
->
TH
=
tarOpen
(
AH
,
fname
,
'w'
);
}
}
/*
/*
...
@@ -931,7 +924,6 @@ _EndBlobs(ArchiveHandle *AH, TocEntry *te)
...
@@ -931,7 +924,6 @@ _EndBlobs(ArchiveHandle *AH, TocEntry *te)
/* WriteInt(AH, 0); */
/* WriteInt(AH, 0); */
tarClose
(
AH
,
ctx
->
blobToc
);
tarClose
(
AH
,
ctx
->
blobToc
);
}
}
...
...
src/bin/pg_dump/pg_dump.c
View file @
2b287020
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.30
4 2002/10/18 22:05:35 petere
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.30
5 2002/10/22 19:15:23 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -292,7 +292,6 @@ main(int argc, char **argv)
...
@@ -292,7 +292,6 @@ main(int argc, char **argv)
break
;
break
;
case
'C'
:
/* Create DB */
case
'C'
:
/* Create DB */
outputCreate
=
1
;
outputCreate
=
1
;
break
;
break
;
...
@@ -326,7 +325,6 @@ main(int argc, char **argv)
...
@@ -326,7 +325,6 @@ main(int argc, char **argv)
oids
=
true
;
oids
=
true
;
break
;
break
;
case
'O'
:
/* Don't reconnect to match owner */
case
'O'
:
/* Don't reconnect to match owner */
outputNoOwner
=
1
;
outputNoOwner
=
1
;
break
;
break
;
...
@@ -1093,7 +1091,6 @@ dumpClasses_dumpData(Archive *fout, char *oid, void *dctxv)
...
@@ -1093,7 +1091,6 @@ dumpClasses_dumpData(Archive *fout, char *oid, void *dctxv)
}
}
archprintf
(
fout
,
");
\n
"
);
archprintf
(
fout
,
");
\n
"
);
}
}
}
while
(
PQntuples
(
res
)
>
0
);
}
while
(
PQntuples
(
res
)
>
0
);
archprintf
(
fout
,
"
\n\n
"
);
archprintf
(
fout
,
"
\n\n
"
);
...
...
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