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
bff074b1
Commit
bff074b1
authored
May 04, 2011
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message style cleanup
parent
ce2fc200
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
src/bin/pg_basebackup/pg_basebackup.c
src/bin/pg_basebackup/pg_basebackup.c
+31
-31
No files found.
src/bin/pg_basebackup/pg_basebackup.c
View file @
bff074b1
...
...
@@ -118,23 +118,23 @@ xmalloc0(int size)
static
void
usage
(
void
)
{
printf
(
_
(
"%s takes
base backups of running PostgreSQL servers
\n\n
"
),
printf
(
_
(
"%s takes
a base backup of a running PostgreSQL server.
\n\n
"
),
progname
);
printf
(
_
(
"Usage:
\n
"
));
printf
(
_
(
" %s [OPTION]...
\n
"
),
progname
);
printf
(
_
(
"
\n
Options controlling the output:
\n
"
));
printf
(
_
(
" -D, --pgdata=
directory
receive base backup into directory
\n
"
));
printf
(
_
(
" -D, --pgdata=
DIRECTORY
receive base backup into directory
\n
"
));
printf
(
_
(
" -F, --format=p|t output format (plain, tar)
\n
"
));
printf
(
_
(
" -x, --xlog include required WAL files in backup
\n
"
));
printf
(
_
(
" -Z, --compress=0-9 compress tar output
\n
"
));
printf
(
_
(
"
\n
General options:
\n
"
));
printf
(
_
(
" -c, --checkpoint=fast|spread
\n
"
" set fast or spread checkpointing
\n
"
));
printf
(
_
(
" -l, --label=
label
set backup label
\n
"
));
printf
(
_
(
" -l, --label=
LABEL
set backup label
\n
"
));
printf
(
_
(
" -P, --progress show progress information
\n
"
));
printf
(
_
(
" -v, --verbose output verbose messages
\n
"
));
printf
(
_
(
" -
?, --help
show this help, then exit
\n
"
));
printf
(
_
(
" -
V, --version
output version information, then exit
\n
"
));
printf
(
_
(
" -
-help
show this help, then exit
\n
"
));
printf
(
_
(
" -
-version
output version information, then exit
\n
"
));
printf
(
_
(
"
\n
Connection options:
\n
"
));
printf
(
_
(
" -h, --host=HOSTNAME database server host or socket directory
\n
"
));
printf
(
_
(
" -p, --port=PORT database server port number
\n
"
));
...
...
@@ -337,7 +337,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_COPY_OUT
)
{
fprintf
(
stderr
,
_
(
"%s: could not get COPY data stream: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not get COPY data stream: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -398,7 +398,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
}
else
if
(
r
==
-
2
)
{
fprintf
(
stderr
,
_
(
"%s: could not read COPY data: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not read COPY data: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -467,7 +467,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_COPY_OUT
)
{
fprintf
(
stderr
,
_
(
"%s: could not get COPY data stream: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not get COPY data stream: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -496,7 +496,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
}
else
if
(
r
==
-
2
)
{
fprintf
(
stderr
,
_
(
"%s: could not read COPY data: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not read COPY data: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -510,7 +510,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
*/
if
(
r
!=
512
)
{
fprintf
(
stderr
,
_
(
"%s:
I
nvalid tar block header size: %i
\n
"
),
fprintf
(
stderr
,
_
(
"%s:
i
nvalid tar block header size: %i
\n
"
),
progname
,
r
);
disconnect_and_exit
(
1
);
}
...
...
@@ -518,7 +518,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
if
(
sscanf
(
copybuf
+
124
,
"%11o"
,
&
current_len_left
)
!=
1
)
{
fprintf
(
stderr
,
_
(
"%s: could not parse file size
!
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not parse file size
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -526,7 +526,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
/* Set permissions on the file */
if
(
sscanf
(
&
copybuf
[
100
],
"%07o "
,
&
filemode
)
!=
1
)
{
fprintf
(
stderr
,
_
(
"%s: could not parse file mode
!
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not parse file mode
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -581,7 +581,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
}
else
{
fprintf
(
stderr
,
_
(
"%s: un
known
link indicator
\"
%c
\"\n
"
),
fprintf
(
stderr
,
_
(
"%s: un
recognized
link indicator
\"
%c
\"\n
"
),
progname
,
copybuf
[
156
]);
disconnect_and_exit
(
1
);
}
...
...
@@ -659,7 +659,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
if
(
file
!=
NULL
)
{
fprintf
(
stderr
,
_
(
"%s: last file was never finished
!
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: last file was never finished
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -740,7 +740,7 @@ GetConnection(void)
if
(
PQstatus
(
tmpconn
)
!=
CONNECTION_OK
)
{
fprintf
(
stderr
,
_
(
"%s: could not connect to server: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not connect to server: %s"
),
progname
,
PQerrorMessage
(
tmpconn
));
exit
(
1
);
}
...
...
@@ -780,7 +780,7 @@ BaseBackup(void)
if
(
PQsendQuery
(
conn
,
current_path
)
==
0
)
{
fprintf
(
stderr
,
_
(
"%s: could not start base backup: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not start base backup: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -791,13 +791,13 @@ BaseBackup(void)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
)
{
fprintf
(
stderr
,
_
(
"%s: could not initiate base backup: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not initiate base backup: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
if
(
PQntuples
(
res
)
!=
1
)
{
fprintf
(
stderr
,
_
(
"%s: no start point returned from server
.
\n
"
),
fprintf
(
stderr
,
_
(
"%s: no start point returned from server
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -813,13 +813,13 @@ BaseBackup(void)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
)
{
fprintf
(
stderr
,
_
(
"%s: could not get backup header: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not get backup header: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
if
(
PQntuples
(
res
)
<
1
)
{
fprintf
(
stderr
,
_
(
"%s: no data returned from server
.
\n
"
),
progname
);
fprintf
(
stderr
,
_
(
"%s: no data returned from server
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -847,7 +847,7 @@ BaseBackup(void)
*/
if
(
format
==
't'
&&
strcmp
(
basedir
,
"-"
)
==
0
&&
PQntuples
(
res
)
>
1
)
{
fprintf
(
stderr
,
_
(
"%s: can only write single tablespace to stdout, database has %i
.
\n
"
),
fprintf
(
stderr
,
_
(
"%s: can only write single tablespace to stdout, database has %i
\n
"
),
progname
,
PQntuples
(
res
));
disconnect_and_exit
(
1
);
}
...
...
@@ -876,13 +876,13 @@ BaseBackup(void)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_TUPLES_OK
)
{
fprintf
(
stderr
,
_
(
"%s: could not get end xlog position from server
.
\n
"
),
fprintf
(
stderr
,
_
(
"%s: could not get end xlog position from server
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
if
(
PQntuples
(
res
)
!=
1
)
{
fprintf
(
stderr
,
_
(
"%s: no end point returned from server
.
\n
"
),
fprintf
(
stderr
,
_
(
"%s: no end point returned from server
\n
"
),
progname
);
disconnect_and_exit
(
1
);
}
...
...
@@ -894,7 +894,7 @@ BaseBackup(void)
res
=
PQgetResult
(
conn
);
if
(
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
{
fprintf
(
stderr
,
_
(
"%s: final receive failed: %s
\n
"
),
fprintf
(
stderr
,
_
(
"%s: final receive failed: %s"
),
progname
,
PQerrorMessage
(
conn
));
disconnect_and_exit
(
1
);
}
...
...
@@ -905,7 +905,7 @@ BaseBackup(void)
PQfinish
(
conn
);
if
(
verbose
)
fprintf
(
stderr
,
"%s: base backup completed
.
\n
"
,
progname
);
fprintf
(
stderr
,
"%s: base backup completed
\n
"
,
progname
);
}
...
...
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