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
3cf6e948
Commit
3cf6e948
authored
Oct 22, 2000
by
Philip Warner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new datlastsysoid field in pg_database + some cleanups & fixes
parent
4ac17421
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
src/bin/pg_dump/pg_backup_archiver.c
src/bin/pg_dump/pg_backup_archiver.c
+5
-0
src/bin/pg_dump/pg_backup_archiver.h
src/bin/pg_dump/pg_backup_archiver.h
+1
-1
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+10
-7
No files found.
src/bin/pg_dump/pg_backup_archiver.c
View file @
3cf6e948
...
...
@@ -220,6 +220,7 @@ void RestoreArchive(Archive* AHX, RestoreOptions *ropt)
*/
if
(
!
AH
->
CustomOutPtr
)
fprintf
(
stderr
,
"%s: WARNING - skipping BLOB restoration
\n
"
,
progname
);
}
else
{
_disableTriggers
(
AH
,
te
,
ropt
);
...
...
@@ -951,6 +952,10 @@ int ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle* AH)
{
res
=
lo_write
(
AH
->
connection
,
AH
->
loFd
,
(
void
*
)
ptr
,
size
*
nmemb
);
ahlog
(
AH
,
5
,
"Wrote %d bytes of BLOB data (result = %d)
\n
"
,
size
*
nmemb
,
res
);
if
(
res
<
size
*
nmemb
)
die_horribly
(
AH
,
"%s: could not write to large object (result = %d, expected %d)
\n
"
,
progname
,
res
,
size
*
nmemb
);
return
res
;
}
else
if
(
AH
->
gzOut
)
...
...
src/bin/pg_dump/pg_backup_archiver.h
View file @
3cf6e948
...
...
@@ -62,7 +62,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 4
#define K_VERS_REV 1
7
#define K_VERS_REV 1
9
/* Data block types */
#define BLK_DATA 1
...
...
src/bin/pg_dump/pg_dump.c
View file @
3cf6e948
...
...
@@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.17
2 2000/10/22 05:27:18 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.17
3 2000/10/22 18:13:09 pjw
Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -140,7 +140,7 @@ static char *checkForQuote(const char *s);
static
void
clearTableInfo
(
TableInfo
*
,
int
);
static
void
dumpOneFunc
(
Archive
*
fout
,
FuncInfo
*
finfo
,
int
i
,
TypeInfo
*
tinfo
,
int
numTypes
);
static
int
findLastBuiltinOid
(
void
);
static
int
findLastBuiltinOid
(
const
char
*
);
static
void
setMaxOid
(
Archive
*
fout
);
static
void
AddAcl
(
char
*
aclbuf
,
const
char
*
keyword
);
...
...
@@ -954,7 +954,7 @@ main(int argc, char **argv)
PQclear
(
res
);
}
g_last_builtin_oid
=
findLastBuiltinOid
();
g_last_builtin_oid
=
findLastBuiltinOid
(
dbname
);
/* Dump the database definition */
if
(
!
dataOnly
)
...
...
@@ -3888,14 +3888,17 @@ setMaxOid(Archive *fout)
*/
static
int
findLastBuiltinOid
(
void
)
findLastBuiltinOid
(
const
char
*
dbname
)
{
PGresult
*
res
;
int
ntups
;
int
last_oid
;
PQExpBuffer
query
=
createPQExpBuffer
();
resetPQExpBuffer
(
query
);
appendPQExpBuffer
(
query
,
"SELECT datlastsysoid from pg_database where datname = '%s'"
,
dbname
);
res
=
PQexec
(
g_conn
,
"SELECT oid from pg_database where datname = 'template1'"
);
res
=
PQexec
(
g_conn
,
query
->
data
);
if
(
res
==
NULL
||
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
)
{
...
...
@@ -3916,7 +3919,7 @@ findLastBuiltinOid(void)
fprintf
(
stderr
,
"There is more than one 'template1' entry in the 'pg_database' table
\n
"
);
exit_nicely
(
g_conn
);
}
last_oid
=
atoi
(
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"oid"
)));
last_oid
=
atoi
(
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"
datlastsys
oid"
)));
PQclear
(
res
);
return
last_oid
;
}
...
...
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