提交 30ab5bd4 编写于 作者: P Peter Eisentraut

More message munging and localization for pg_dump, especially the

--verbose messages, which had not been considered so far.  Output to the
terminal should okay now; comments written into the dump are still English
only, which may or may not be the desirable thing.
上级 3ec9fb89
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.56 2001/06/27 21:21:36 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.57 2001/07/03 20:21:47 petere Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
......@@ -179,7 +179,7 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
inhinfo[i].inhparent,
oid);
exit(2);
exit_nicely();
}
(**parentIndexes)[j] = parentInd;
result[j++] = tblinfo[parentInd].relname;
......@@ -219,7 +219,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
if (argNum >= arraysize)
{
write_msg(NULL, "parseNumericArray: too many numbers\n");
exit(2);
exit_nicely();
}
temp[j] = '\0';
array[argNum++] = strdup(temp);
......@@ -234,7 +234,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
j >= sizeof(temp) - 1)
{
write_msg(NULL, "parseNumericArray: bogus number\n");
exit(2);
exit_nicely();
}
temp[j++] = s;
}
......@@ -297,69 +297,57 @@ dumpSchema(Archive *fout,
IndInfo *indinfo = NULL;
if (g_verbose)
fprintf(stderr, "%s reading user-defined types %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading user-defined types\n");
tinfo = getTypes(&numTypes);
if (g_verbose)
fprintf(stderr, "%s reading user-defined functions %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading user-defined functions\n");
finfo = getFuncs(&numFuncs);
if (g_verbose)
fprintf(stderr, "%s reading user-defined aggregates %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading user-defined aggregate functions\n");
agginfo = getAggregates(&numAggregates);
if (g_verbose)
fprintf(stderr, "%s reading user-defined operators %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading user-defined operators\n");
oprinfo = getOperators(&numOperators);
if (g_verbose)
fprintf(stderr, "%s reading user-defined tables %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading user-defined tables\n");
tblinfo = getTables(&numTables, finfo, numFuncs);
if (g_verbose)
fprintf(stderr, "%s reading indexes information %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading index information\n");
indinfo = getIndexes(&numIndexes);
if (g_verbose)
fprintf(stderr, "%s reading table inheritance information %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "reading table inheritance information\n");
inhinfo = getInherits(&numInherits);
if (g_verbose)
fprintf(stderr, "%s finding the attribute names and types for each table %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "finding the column names and types for each table\n");
getTableAttrs(tblinfo, numTables);
if (g_verbose)
fprintf(stderr, "%s flagging inherited attributes in subtables %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "flagging inherited columns in subtables\n");
flagInhAttrs(tblinfo, numTables, inhinfo, numInherits);
if (!tablename && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out database comment %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out database comment\n");
dumpDBComment(fout);
}
if (!tablename && fout)
{
if (g_verbose)
fprintf(stderr, "%s dumping out user-defined types %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out user-defined types\n");
dumpTypes(fout, finfo, numFuncs, tinfo, numTypes);
}
if (g_verbose)
fprintf(stderr, "%s dumping out tables %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out tables\n");
dumpTables(fout, tblinfo, numTables, indinfo, numIndexes, inhinfo, numInherits,
tinfo, numTypes, tablename, aclsSkip, oids, schemaOnly, dataOnly);
......@@ -367,40 +355,35 @@ dumpSchema(Archive *fout,
if (fout && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out indexes %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out indexes\n");
dumpIndexes(fout, indinfo, numIndexes, tblinfo, numTables, tablename);
}
if (!tablename && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out user-defined procedural languages %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out user-defined procedural languages\n");
dumpProcLangs(fout, finfo, numFuncs, tinfo, numTypes);
}
if (!tablename && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out user-defined functions %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out user-defined functions\n");
dumpFuncs(fout, finfo, numFuncs, tinfo, numTypes);
}
if (!tablename && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out user-defined aggregates %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out user-defined aggregate functions\n");
dumpAggs(fout, agginfo, numAggregates, tinfo, numTypes);
}
if (!tablename && !dataOnly)
{
if (g_verbose)
fprintf(stderr, "%s dumping out user-defined operators %s\n",
g_comment_start, g_comment_end);
write_msg(NULL, "dumping out user-defined operators\n");
dumpOprs(fout, oprinfo, numOperators, tinfo, numTypes);
}
......@@ -490,7 +473,7 @@ flagInhAttrs(TableInfo *tblinfo, int numTables,
/* shouldn't happen unless findParentsByOid is broken */
write_msg(NULL, "failed sanity check, table \"%s\" not found by flagInhAttrs\n",
tblinfo[i].parentRels[k]);
exit(2);
exit_nicely();
};
inhAttrInd = strInArray(tblinfo[i].attnames[j],
......
此差异已折叠。
# $Header: /cvsroot/pgsql/src/bin/pg_dump/nls.mk,v 1.1 2001/06/27 21:21:37 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/nls.mk,v 1.2 2001/07/03 20:21:48 petere Exp $
CATALOG_NAME := pg_dump
AVAIL_LANGUAGES := de
GETTEXT_FILES := pg_dump.c common.c pg_backup_archiver.c pg_backup_custom.c \
pg_backup_db.c pg_backup_files.c pg_backup_null.c \
pg_backup_tar.c pg_restore.c
GETTEXT_TRIGGERS:= write_msg:2 die_horribly:3 exit_horribly:3 simple_prompt \
ExecuteSqlCommand:3
ExecuteSqlCommand:3 ahlog:3
......@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.28 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.29 2001/07/03 20:21:48 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -91,7 +91,7 @@ static void _fixupOidInfo(TocEntry *te);
static Oid _findMaxOID(const char *((*deps)[]));
const char *progname;
static char *modulename = "archiver";
static char *modulename = gettext_noop("archiver");
static void _write_msg(const char *modulename, const char *fmt, va_list ap);
static void _die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap);
......@@ -170,7 +170,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
*/
if (ropt->useDB)
{
ahlog(AH, 1, "Connecting to database for restore\n");
ahlog(AH, 1, "connecting to database for restore\n");
if (AH->version < K_VERS_1_3)
die_horribly(AH, modulename, "direct database connections are not supported in pre-1.3 archives\n");
......@@ -219,7 +219,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
if (impliedDataOnly)
{
ropt->dataOnly = impliedDataOnly;
ahlog(AH, 1, "Implied data-only restore\n");
ahlog(AH, 1, "implied data-only restore\n");
}
}
......@@ -247,8 +247,9 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
{
reqs = _tocEntryRequired(te, ropt);
if (((reqs & 1) != 0) && te->dropStmt)
{ /* We want the schema */
ahlog(AH, 1, "Dropping %s %s\n", te->desc, te->name);
{
/* We want the schema */
ahlog(AH, 1, "dropping %s %s\n", te->desc, te->name);
/* Reconnect if necessary */
_reconnectAsOwner(AH, "-", te);
/* Drop it */
......@@ -284,14 +285,14 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* Reconnect if necessary */
_reconnectAsOwner(AH, "-", te);
ahlog(AH, 1, "Creating %s %s\n", te->desc, te->name);
ahlog(AH, 1, "creating %s %s\n", te->desc, te->name);
_printTocEntry(AH, te, ropt, false);
defnDumped = true;
/* If we created a DB, connect to it... */
if (strcmp(te->desc, "DATABASE") == 0)
{
ahlog(AH, 1, "Connecting to new DB '%s' as %s\n", te->name, te->owner);
ahlog(AH, 1, "connecting to new database %s as user %s\n", te->name, te->owner);
_reconnectAsUser(AH, te->name, te->owner);
}
}
......@@ -346,7 +347,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
*/
_reconnectAsOwner(AH, "-", te);
ahlog(AH, 1, "Restoring data for %s \n", te->name);
ahlog(AH, 1, "restoring data for table %s\n", te->name);
/*
* If we have a copy statement, use it. As of V1.3, these
......@@ -367,7 +368,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
}
} else if (!defnDumped) {
/* If we haven't already dumped the defn part, do so now */
ahlog(AH, 1, "Executing %s %s\n", te->desc, te->name);
ahlog(AH, 1, "executing %s %s\n", te->desc, te->name);
_printTocEntry(AH, te, ropt, false);
}
}
......@@ -391,18 +392,18 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
if (strcmp(te->desc, "TABLE DATA") == 0)
{
ahlog(AH, 2, "Checking if we loaded %s\n", te->name);
ahlog(AH, 2, "checking whether we loaded %s\n", te->name);
reqs = _tocEntryRequired(te, ropt);
if ((reqs & 2) != 0) /* We loaded the data */
{
ahlog(AH, 1, "Fixing up BLOB ref for %s\n", te->name);
ahlog(AH, 1, "fixing up BLOB reference for %s\n", te->name);
FixupBlobRefs(AH, te->name);
}
}
else
ahlog(AH, 2, "Ignoring BLOB xrefs for %s %s\n", te->desc, te->name);
ahlog(AH, 2, "ignoring BLOB cross-references for %s %s\n", te->desc, te->name);
te = te->next;
}
......@@ -489,7 +490,7 @@ _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *rop
}
}
ahlog(AH, 1, "Disabling triggers\n");
ahlog(AH, 1, "disabling triggers\n");
/*
* Disable them. This is a hack. Needs to be done via an appropriate
......@@ -549,7 +550,7 @@ _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt
}
}
ahlog(AH, 1, "Enabling triggers\n");
ahlog(AH, 1, "enabling triggers\n");
/*
* Enable them. This is a hack. Needs to be done via an appropriate
......@@ -752,14 +753,14 @@ EndRestoreBlobs(ArchiveHandle *AH)
{
if (AH->txActive)
{
ahlog(AH, 2, "Committing BLOB transactions\n");
ahlog(AH, 2, "committing BLOB transactions\n");
CommitTransaction(AH);
}
if (AH->blobTxActive)
CommitTransactionXref(AH);
ahlog(AH, 1, "Restored %d BLOBs\n", AH->blobCount);
ahlog(AH, 1, "restored %d BLOBs\n", AH->blobCount);
}
......@@ -769,7 +770,7 @@ EndRestoreBlobs(ArchiveHandle *AH)
void
StartRestoreBlob(ArchiveHandle *AH, Oid oid)
{
int loOid;
Oid loOid;
AH->blobCount++;
......@@ -787,7 +788,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
if (!AH->txActive)
{
ahlog(AH, 2, "Starting BLOB transactions\n");
ahlog(AH, 2, "starting BLOB transactions\n");
StartTransaction(AH);
}
if (!AH->blobTxActive)
......@@ -797,7 +798,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
if (loOid == 0)
die_horribly(AH, modulename, "could not create BLOB\n");
ahlog(AH, 2, "Restoring BLOB oid %d as %d\n", oid, loOid);
ahlog(AH, 2, "restoring BLOB oid %u as %u\n", oid, loOid);
InsertBlobXref(AH, oid, loOid);
......@@ -819,7 +820,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
if (((AH->blobCount / BLOB_BATCH_SIZE) * BLOB_BATCH_SIZE) == AH->blobCount)
{
ahlog(AH, 2, "Committing BLOB transactions\n");
ahlog(AH, 2, "committing BLOB transactions\n");
CommitTransaction(AH);
CommitTransactionXref(AH);
}
......@@ -1166,7 +1167,7 @@ ahlog(ArchiveHandle *AH, int level, const char *fmt,...)
return;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
_write_msg(NULL, fmt, ap);
va_end(ap);
}
......@@ -1193,7 +1194,7 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
if (AH->writingBlob)
{
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);
ahlog(AH, 5, "wrote %d bytes of BLOB data (result = %d)\n", size * nmemb, res);
if (res < size * nmemb)
die_horribly(AH, modulename, "could not write to large object (result: %d, expected: %d)\n",
res, size * nmemb);
......@@ -1239,7 +1240,7 @@ static void
_write_msg(const char *modulename, const char *fmt, va_list ap)
{
if (modulename)
fprintf(stderr, "%s[%s]: ", progname, gettext(modulename));
fprintf(stderr, "%s: [%s] ", progname, gettext(modulename));
else
fprintf(stderr, "%s: ", progname);
vfprintf(stderr, gettext(fmt), ap);
......@@ -1260,6 +1261,8 @@ static void
_die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap)
{
_write_msg(modulename, fmt, ap);
if (AH->public.verbose)
write_msg(NULL, "*** aborted because of error\n");
if (AH)
if (AH->connection)
......@@ -1813,7 +1816,7 @@ ReadToc(ArchiveHandle *AH)
if (AH->ReadExtraTocPtr)
(*AH->ReadExtraTocPtr) (AH, te);
ahlog(AH, 3, "Read TOC entry %d (id %d) for %s %s\n", i, te->id, te->desc, te->name);
ahlog(AH, 3, "read TOC entry %d (id %d) for %s %s\n", i, te->id, te->desc, te->name);
te->prev = AH->toc->prev;
AH->toc->prev->next = te;
......@@ -2052,7 +2055,7 @@ ReadHead(ArchiveHandle *AH)
AH->createDate = mktime(&crtm);
if (AH->createDate == (time_t) -1)
write_msg(modulename, "WARNING: bad creation date in header\n");
write_msg(modulename, "WARNING: invalid creation date in header\n");
}
}
......
......@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.35 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.36 2001/07/03 20:21:48 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
* - Initial version.
......@@ -316,8 +316,8 @@ extern char *ConnectedUser(ArchiveHandle *AH);
extern int ConnectedUserIsSuperuser(ArchiveHandle *AH);
int ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH);
int ahprintf(ArchiveHandle *AH, const char *fmt,...);
int ahprintf(ArchiveHandle *AH, const char *fmt,...) __attribute__((format(printf,2,3)));
void ahlog(ArchiveHandle *AH, int level, const char *fmt,...);
void ahlog(ArchiveHandle *AH, int level, const char *fmt,...) __attribute__((format(printf,3,4)));
#endif
......@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.12 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.13 2001/07/03 20:21:48 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -102,7 +102,7 @@ static void _EndDataCompressor(ArchiveHandle *AH, TocEntry *te);
static int _getFilePos(ArchiveHandle *AH, lclContext *ctx);
static int _DoDeflate(ArchiveHandle *AH, lclContext *ctx, int flush);
static char *modulename = "custom archiver";
static char *modulename = gettext_noop("custom archiver");
......@@ -193,7 +193,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
else
AH->FH = stdin;
if (!AH->FH)
die_horribly(AH, modulename, "could not open archive file %s: %s", AH->fSpec, strerror(errno));
die_horribly(AH, modulename, "could not open archive file %s: %s\n", AH->fSpec, strerror(errno));
ctx->hasSeek = (fseek(AH->FH, 0, SEEK_CUR) == 0);
......
......@@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.20 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.21 2001/07/03 20:21:48 petere Exp $
*
* NOTES
*
......@@ -20,7 +20,6 @@
*-------------------------------------------------------------------------
*/
#include "pg_dump.h"
#include "pg_backup.h"
#include "pg_backup_archiver.h"
#include "pg_backup_db.h"
......@@ -38,7 +37,7 @@
#include "strdup.h"
#endif
static const char *modulename = "archiver (db)";
static const char *modulename = gettext_noop("archiver (db)");
static void _check_database_version(ArchiveHandle *AH, bool ignoreVersion);
static PGconn *_connectDB(ArchiveHandle *AH, const char *newdbname, char *newUser);
......@@ -275,7 +274,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, char *requser)
else
newuser = (char *) requser;
ahlog(AH, 1, "Connecting to %s as %s\n", newdb, newuser);
ahlog(AH, 1, "connecting to database %s as user %s\n", newdb, newuser);
if (AH->requirePassword)
{
......@@ -347,7 +346,7 @@ ConnectDatabase(Archive *AHX,
bool need_pass = false;
if (AH->connection)
die_horribly(AH, modulename, "already connected to database\n");
die_horribly(AH, modulename, "already connected to a database\n");
if (!dbname && !(dbname = getenv("PGDATABASE")))
die_horribly(AH, modulename, "no database name specified\n");
......@@ -449,7 +448,7 @@ _executeSqlCommand(ArchiveHandle *AH, PGconn *conn, PQExpBuffer qry, char *desc)
/* fprintf(stderr, "Executing: '%s'\n\n", qry->data); */
res = PQexec(conn, qry->data);
if (!res)
die_horribly(AH, modulename, "%s: no result from backend\n", desc);
die_horribly(AH, modulename, "%s: no result from server\n", desc);
if (PQresultStatus(res) != PGRES_COMMAND_OK && PQresultStatus(res) != PGRES_TUPLES_OK)
{
......@@ -701,7 +700,7 @@ FixupBlobRefs(ArchiveHandle *AH, char *tablename)
if ((n = PQntuples(res)) == 0)
{
/* We're done */
ahlog(AH, 1, "No OID attributes in table %s\n", tablename);
ahlog(AH, 1, "no OID type columns in table %s\n", tablename);
PQclear(res);
return;
}
......@@ -710,7 +709,7 @@ FixupBlobRefs(ArchiveHandle *AH, char *tablename)
{
attr = PQgetvalue(res, i, 0);
ahlog(AH, 1, " - %s.%s\n", tablename, attr);
ahlog(AH, 1, "fixing BLOB cross-references for %s.%s\n", tablename, attr);
resetPQExpBuffer(tblQry);
......@@ -725,7 +724,7 @@ FixupBlobRefs(ArchiveHandle *AH, char *tablename)
"(select * from %s x where x.oldOid = \"%s\".\"%s\");",
BLOB_XREF_TABLE, tablename, attr);
ahlog(AH, 10, " - sql:\n%s\n", tblQry->data);
ahlog(AH, 10, "SQL: %s\n", tblQry->data);
uRes = PQexec(AH->blobConnection, tblQry->data);
if (!uRes)
......@@ -757,7 +756,7 @@ CreateBlobXrefTable(ArchiveHandle *AH)
if (!AH->blobConnection)
AH->blobConnection = _connectDB(AH, NULL, NULL);
ahlog(AH, 1, "Creating table for BLOBS xrefs\n");
ahlog(AH, 1, "creating table for BLOB cross-references\n");
appendPQExpBuffer(qry, "Create Temporary Table %s(oldOid oid, newOid oid);", BLOB_XREF_TABLE);
......
......@@ -20,7 +20,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.11 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.12 2001/07/03 20:21:48 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -74,7 +74,7 @@ typedef struct
char *filename;
} lclTocEntry;
static char *modulename = "file archiver";
static char *modulename = gettext_noop("file archiver");
static void _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt);
static void _getBlobTocEntry(ArchiveHandle *AH, int *oid, char *fname);
......@@ -120,7 +120,7 @@ InitArchiveFmt_Files(ArchiveHandle *AH)
{
write_msg(modulename, "WARNING:\n"
" This format is for demonstration purposes, it is not intended for\n"
" This format is for demonstration purposes; it is not intended for\n"
" normal use. Files will be written in the current working directory.\n");
if (AH->fSpec && strcmp(AH->fSpec, "") != 0)
......
......@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.16 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.17 2001/07/03 20:21:48 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -101,7 +101,7 @@ typedef struct
char *filename;
} lclTocEntry;
static char *modulename = "tar archiver";
static char *modulename = gettext_noop("tar archiver");
static void _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt);
......@@ -698,7 +698,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
static void
_LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
{
int oid;
Oid oid;
lclContext *ctx = (lclContext *) AH->formatData;
TAR_MEMBER *th;
int cnt;
......@@ -711,11 +711,11 @@ _LoadBlobs(ArchiveHandle *AH, RestoreOptions *ropt)
{
ctx->FH = th;
oid = atoi(&th->targetFile[5]);
oid = (Oid)strtoul(&th->targetFile[5], NULL, 10);
if (strncmp(th->targetFile, "blob_", 5) == 0 && oid != 0)
{
ahlog(AH, 1, " - Restoring BLOB oid %d\n", oid);
ahlog(AH, 1, "restoring BLOB oid %u\n", oid);
StartRestoreBlob(AH, oid);
......@@ -1088,7 +1088,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
/* Go to end of current file, if any */
if (ctx->tarFHpos != 0)
{
ahlog(AH, 4, "Moving from %d (%x) to next member at file position %d (%x)\n",
ahlog(AH, 4, "moving from position %d (%x) to next member at file position %d (%x)\n",
ctx->tarFHpos, ctx->tarFHpos,
ctx->tarNextMember, ctx->tarNextMember);
......@@ -1096,7 +1096,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
_tarReadRaw(AH, &c, 1, NULL, ctx->tarFH);
}
ahlog(AH, 4, "Now at file position %d (%x)\n", ctx->tarFHpos, ctx->tarFHpos);
ahlog(AH, 4, "now at file position %d (%x)\n", ctx->tarFHpos, ctx->tarFHpos);
/* We are at the start of the file. or at the next member */
......@@ -1115,7 +1115,7 @@ _tarPositionTo(ArchiveHandle *AH, const char *filename)
while (filename != NULL && strcmp(th->targetFile, filename) != 0)
{
ahlog(AH, 4, "Skipping member %s\n", th->targetFile);
ahlog(AH, 4, "skipping tar member %s\n", th->targetFile);
id = atoi(th->targetFile);
if ((TocIDRequired(AH, id, AH->ropt) & 2) != 0)
......@@ -1202,7 +1202,7 @@ _tarGetHeader(ArchiveHandle *AH, TAR_MEMBER *th)
sscanf(&h[124], "%12o", &len);
sscanf(&h[148], "%8o", &sum);
ahlog(AH, 3, "TOC Entry %s at %d (len=%d, chk=%d)\n", &name[0], hPos, len, sum);
ahlog(AH, 3, "TOC Entry %s at %d (length %d, checksum %d)\n", &name[0], hPos, len, sum);
if (chk != sum)
die_horribly(AH, modulename,
......
此差异已折叠。
......@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_dump.h,v 1.64 2001/06/27 21:21:37 petere Exp $
* $Id: pg_dump.h,v 1.65 2001/07/03 20:21:50 petere Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
......@@ -275,5 +275,6 @@ extern void dumpTables(Archive *fout, TableInfo *tbinfo, int numTables,
extern void dumpIndexes(Archive *fout, IndInfo *indinfo, int numIndexes,
TableInfo *tbinfo, int numTables, const char *tablename);
extern const char *fmtId(const char *identifier, bool force_quotes);
extern void exit_nicely(void);
#endif /* PG_DUMP_H */
......@@ -34,7 +34,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.21 2001/06/27 21:21:37 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.22 2001/07/03 20:21:50 petere Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
......@@ -248,7 +248,7 @@ main(int argc, char **argv)
case 'u':
opts->requirePassword = true;
opts->username = simple_prompt("Username: ", 100, true);
opts->username = simple_prompt("User name: ", 100, true);
break;
case 'U':
......
......@@ -12,7 +12,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: c.h,v 1.95 2001/06/03 14:53:56 petere Exp $
* $Id: c.h,v 1.96 2001/07/03 20:21:50 petere Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -73,6 +73,8 @@
#else
#define gettext(x) (x)
#endif
#define gettext_noop(x) (x)
/* ----------------------------------------------------------------
* Section 1: hacks to cope with non-ANSI C compilers
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册