summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-07-23 08:47:41 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-07-23 08:47:41 +0000
commitc154fc3a204a1452297bf399bbc3caef7e0f16b4 (patch)
treeec111344790e54e6080f36c0b5e046ac5c89578f /src/bin/pg_dump
parenta0743b132eef5ed8896f4c2d551af424691ba350 (diff)
downloadpostgresql-c154fc3a204a1452297bf399bbc3caef7e0f16b4.tar.gz
Apply message style guide to frontend programs.
Diffstat (limited to 'src/bin/pg_dump')
-rw-r--r--src/bin/pg_dump/common.c16
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c48
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c18
-rw-r--r--src/bin/pg_dump/pg_backup_db.c8
-rw-r--r--src/bin/pg_dump/pg_backup_tar.c12
-rw-r--r--src/bin/pg_dump/pg_dump.c106
-rw-r--r--src/bin/pg_dump/pg_dumpall.c22
-rw-r--r--src/bin/pg_dump/pg_restore.c6
8 files changed, 118 insertions, 118 deletions
diff --git a/src/bin/pg_dump/common.c b/src/bin/pg_dump/common.c
index a703660aa2..e404924f44 100644
--- a/src/bin/pg_dump/common.c
+++ b/src/bin/pg_dump/common.c
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.72 2002/10/25 01:33:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/common.c,v 1.73 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -71,7 +71,7 @@ dumpSchema(Archive *fout,
OpclassInfo *opcinfo;
if (g_verbose)
- write_msg(NULL, "reading namespaces\n");
+ write_msg(NULL, "reading schemas\n");
nsinfo = getNamespaces(&numNamespaces);
if (g_verbose)
@@ -125,7 +125,7 @@ dumpSchema(Archive *fout,
if (!dataOnly)
{
if (g_verbose)
- write_msg(NULL, "dumping out user-defined namespaces\n");
+ write_msg(NULL, "dumping out user-defined schemas\n");
dumpNamespaces(fout, nsinfo, numNamespaces);
}
@@ -449,7 +449,7 @@ findOprByOid(OprInfo *oprinfo, int numOprs, const char *oid)
}
/* should never get here */
- write_msg(NULL, "failed sanity check, operator with oid %s not found\n", oid);
+ write_msg(NULL, "failed sanity check, operator with OID %s not found\n", oid);
/* no suitable operator name was found */
return (NULL);
@@ -499,12 +499,12 @@ findParentsByOid(TableInfo *tblinfo, int numTables,
{
selfInd = findTableByOid(tblinfo, numTables, oid);
if (selfInd >= 0)
- write_msg(NULL, "failed sanity check, parent oid %s of table %s (oid %s) not found\n",
+ write_msg(NULL, "failed sanity check, parent OID %s of table \"%s\" (OID %s) not found\n",
inhinfo[i].inhparent,
tblinfo[selfInd].relname,
oid);
else
- write_msg(NULL, "failed sanity check, parent oid %s of table (oid %s) not found\n",
+ write_msg(NULL, "failed sanity check, parent OID %s of table (OID %s) not found\n",
inhinfo[i].inhparent,
oid);
@@ -542,7 +542,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
{
if (argNum >= arraysize)
{
- write_msg(NULL, "parseNumericArray: too many numbers\n");
+ write_msg(NULL, "could not parse numeric array: too many numbers\n");
exit_nicely();
}
temp[j] = '\0';
@@ -557,7 +557,7 @@ parseNumericArray(const char *str, char **array, int arraysize)
if (!(isdigit((unsigned char) s) || s == '-') ||
j >= sizeof(temp) - 1)
{
- write_msg(NULL, "parseNumericArray: bogus number\n");
+ write_msg(NULL, "could not parse numeric array: invalid character in number\n");
exit_nicely();
}
temp[j++] = s;
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 9afbdfe07f..5acfc08ba3 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.72 2003/05/14 03:26:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.73 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -119,7 +119,7 @@ CloseArchive(Archive *AHX)
res = fclose(AH->OF);
if (res != 0)
- die_horribly(AH, modulename, "could not close the output file in CloseArchive\n");
+ die_horribly(AH, modulename, "could not close output archive file\n");
}
/* Public */
@@ -259,7 +259,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* If we created a DB, connect to it... */
if (strcmp(te->desc, "DATABASE") == 0)
{
- ahlog(AH, 1, "connecting to new database %s as user %s\n", te->tag, te->owner);
+ ahlog(AH, 1, "connecting to new database \"%s\" as user \"%s\"\n", te->tag, te->owner);
_reconnectAsUser(AH, te->tag, te->owner);
}
}
@@ -284,7 +284,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
{
#ifndef HAVE_LIBZ
if (AH->compression != 0)
- die_horribly(AH, modulename, "unable to restore from compressed archive (not configured for compression support)\n");
+ die_horribly(AH, modulename, "cannot restore from compressed archive (not configured for compression support)\n");
#endif
_printTocEntry(AH, te, ropt, true);
@@ -304,7 +304,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
* we don't want warnings.
*/
if (!AH->CustomOutPtr)
- write_msg(modulename, "WARNING: skipping large object restoration\n");
+ write_msg(modulename, "WARNING: skipping large-object restoration\n");
}
else
{
@@ -317,7 +317,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
_reconnectAsOwner(AH, NULL, te);
_selectOutputSchema(AH, te->namespace);
- ahlog(AH, 1, "restoring data for table %s\n", te->tag);
+ ahlog(AH, 1, "restoring data for table \"%s\"\n", te->tag);
/*
* If we have a copy statement, use it. As of
@@ -364,18 +364,18 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
/* Is it table data? */
if (strcmp(te->desc, "TABLE DATA") == 0)
{
- ahlog(AH, 2, "checking whether we loaded %s\n", te->tag);
+ ahlog(AH, 2, "checking whether we loaded \"%s\"\n", te->tag);
reqs = _tocEntryRequired(te, ropt);
if ((reqs & REQ_DATA) != 0) /* We loaded the data */
{
- ahlog(AH, 1, "fixing up large object cross-reference for %s\n", te->tag);
+ ahlog(AH, 1, "fixing up large-object cross-reference for \"%s\"\n", te->tag);
FixupBlobRefs(AH, te);
}
}
else
- ahlog(AH, 2, "ignoring large object cross-references for %s %s\n", te->desc, te->tag);
+ ahlog(AH, 2, "ignoring large-object cross-references for %s %s\n", te->desc, te->tag);
te = te->next;
}
@@ -584,7 +584,7 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
ArchiveHandle *AH = (ArchiveHandle *) AHX;
if (!AH->currToc)
- die_horribly(AH, modulename, "WriteData cannot be called outside the context of a DataDumper routine\n");
+ die_horribly(AH, modulename, "internal error -- WriteData cannot be called outside the context of a DataDumper routine\n");
return (*AH->WriteDataPtr) (AH, data, dLen);
}
@@ -708,7 +708,7 @@ StartBlob(Archive *AHX, Oid oid)
ArchiveHandle *AH = (ArchiveHandle *) AHX;
if (!AH->StartBlobPtr)
- die_horribly(AH, modulename, "large object output not supported in chosen format\n");
+ die_horribly(AH, modulename, "large-object output not supported in chosen format\n");
(*AH->StartBlobPtr) (AH, AH->currToc, oid);
@@ -748,7 +748,7 @@ EndRestoreBlobs(ArchiveHandle *AH)
{
if (AH->txActive)
{
- ahlog(AH, 2, "committing large object transactions\n");
+ ahlog(AH, 2, "committing large-object transactions\n");
CommitTransaction(AH);
}
@@ -786,7 +786,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
if (!AH->txActive)
{
- ahlog(AH, 2, "starting large object transactions\n");
+ ahlog(AH, 2, "starting large-object transactions\n");
StartTransaction(AH);
}
if (!AH->blobTxActive)
@@ -796,7 +796,7 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid)
if (loOid == 0)
die_horribly(AH, modulename, "could not create large object\n");
- ahlog(AH, 2, "restoring large object with oid %u as %u\n", oid, loOid);
+ ahlog(AH, 2, "restoring large object with OID %u as %u\n", oid, loOid);
InsertBlobXref(AH, oid, loOid);
@@ -817,7 +817,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
res = lo_write(AH->connection, AH->loFd, (void *) AH->lo_buf, AH->lo_buf_used);
- ahlog(AH, 5, "wrote remaining %lu bytes of large object data (result = %lu)\n",
+ ahlog(AH, 5, "wrote remaining %lu bytes of large-object data (result = %lu)\n",
(unsigned long) AH->lo_buf_used, (unsigned long) res);
if (res != AH->lo_buf_used)
die_horribly(AH, modulename, "could not write to large object (result: %lu, expected: %lu)\n",
@@ -833,7 +833,7 @@ EndRestoreBlob(ArchiveHandle *AH, Oid oid)
*/
if (((AH->blobCount / BLOB_BATCH_SIZE) * BLOB_BATCH_SIZE) == AH->blobCount)
{
- ahlog(AH, 2, "committing large object transactions\n");
+ ahlog(AH, 2, "committing large-object transactions\n");
CommitTransaction(AH);
CommitTransactionXref(AH);
}
@@ -985,7 +985,7 @@ SortTocFromFile(Archive *AHX, RestoreOptions *ropt)
/* Find TOC entry */
te = _getTocEntry(AH, id);
if (!te)
- die_horribly(AH, modulename, "could not find entry for id %d\n", id);
+ die_horribly(AH, modulename, "could not find entry for ID %d\n", id);
ropt->idWanted[id - 1] = 1;
@@ -1775,7 +1775,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
break;
default:
- die_horribly(AH, modulename, "unrecognized file format '%d'\n", fmt);
+ die_horribly(AH, modulename, "unrecognized file format \"%d\"\n", fmt);
}
return AH;
@@ -1888,7 +1888,7 @@ ReadToc(ArchiveHandle *AH)
/* Sanity check */
if (te->id <= 0 || te->id > AH->tocCount)
- die_horribly(AH, modulename, "entry id %d out of range - perhaps a corrupt TOC\n", te->id);
+ die_horribly(AH, modulename, "entry ID %d out of range -- perhaps a corrupt TOC\n", te->id);
te->hadDumper = ReadInt(AH);
te->oid = ReadStr(AH);
@@ -1945,7 +1945,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->tag);
+ ahlog(AH, 3, "read TOC entry %d (ID %d) for %s %s\n", i, te->id, te->desc, te->tag);
te->prev = AH->toc->prev;
AH->toc->prev->next = te;
@@ -2071,7 +2071,7 @@ _doSetSessionAuth(ArchiveHandle *AH, const char *user)
res = PQexec(AH->connection, cmd->data);
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
- die_horribly(AH, modulename, "could not set session user to %s: %s",
+ die_horribly(AH, modulename, "could not set session user to \"%s\": %s",
user, PQerrorMessage(AH->connection));
PQclear(res);
@@ -2185,7 +2185,7 @@ _selectOutputSchema(ArchiveHandle *AH, const char *schemaName)
res = PQexec(AH->connection, qry->data);
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
- die_horribly(AH, modulename, "could not set search_path to %s: %s",
+ die_horribly(AH, modulename, "could not set search_path to \"%s\": %s",
schemaName, PQerrorMessage(AH->connection));
PQclear(res);
@@ -2246,7 +2246,7 @@ WriteHead(ArchiveHandle *AH)
#ifndef HAVE_LIBZ
if (AH->compression != 0)
write_msg(modulename, "WARNING: requested compression not available in this "
- "installation - archive will be uncompressed\n");
+ "installation -- archive will be uncompressed\n");
AH->compression = 0;
#endif
@@ -2327,7 +2327,7 @@ ReadHead(ArchiveHandle *AH)
#ifndef HAVE_LIBZ
if (AH->compression != 0)
- write_msg(modulename, "WARNING: archive is compressed, but this installation does not support compression - no data will be available\n");
+ write_msg(modulename, "WARNING: archive is compressed, but this installation does not support compression -- no data will be available\n");
#endif
if (AH->version >= K_VERS_1_4)
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index c2fcef7536..49a2701a12 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.23 2002/10/25 01:33:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.24 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -177,7 +177,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
AH->FH = stdout;
if (!AH->FH)
- 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 = checkSeek(AH->FH);
}
@@ -188,7 +188,7 @@ InitArchiveFmt_Custom(ArchiveHandle *AH)
else
AH->FH = stdin;
if (!AH->FH)
- 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 = checkSeek(AH->FH);
@@ -444,7 +444,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
if ((TocIDRequired(AH, id, ropt) & 2) != 0)
die_horribly(AH, modulename,
"Dumping a specific TOC data block out of order is not supported"
- " without id on this input stream (fseek required)\n");
+ " without ID on this input stream (fseek required)\n");
switch (blkType)
{
@@ -476,7 +476,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
/* Are we sane? */
if (id != te->id)
- die_horribly(AH, modulename, "found unexpected block ID (%d) when reading data - expected %d\n",
+ die_horribly(AH, modulename, "found unexpected block ID (%d) when reading data -- expected %d\n",
id, te->id);
switch (blkType)
@@ -551,7 +551,7 @@ _PrintData(ArchiveHandle *AH)
cnt = fread(in, 1, blkLen, AH->FH);
if (cnt != blkLen)
die_horribly(AH, modulename,
- "could not read data block - expected %lu, got %lu\n",
+ "could not read data block -- expected %lu, got %lu\n",
(unsigned long) blkLen, (unsigned long) cnt);
ctx->filePos += blkLen;
@@ -569,7 +569,7 @@ _PrintData(ArchiveHandle *AH)
zp->avail_out = zlibOutSize;
res = inflate(zp, 0);
if (res != Z_OK && res != Z_STREAM_END)
- die_horribly(AH, modulename, "unable to uncompress data: %s\n", zp->msg);
+ die_horribly(AH, modulename, "could not uncompress data: %s\n", zp->msg);
out[zlibOutSize - zp->avail_out] = '\0';
ahwrite(out, 1, zlibOutSize - zp->avail_out, AH);
@@ -599,7 +599,7 @@ _PrintData(ArchiveHandle *AH)
zp->avail_out = zlibOutSize;
res = inflate(zp, 0);
if (res != Z_OK && res != Z_STREAM_END)
- die_horribly(AH, modulename, "unable to uncompress data: %s\n", zp->msg);
+ die_horribly(AH, modulename, "could not uncompress data: %s\n", zp->msg);
out[zlibOutSize - zp->avail_out] = '\0';
ahwrite(out, 1, zlibOutSize - zp->avail_out, AH);
@@ -674,7 +674,7 @@ _skipData(ArchiveHandle *AH)
cnt = fread(in, 1, blkLen, AH->FH);
if (cnt != blkLen)
die_horribly(AH, modulename,
- "could not read data block - expected %lu, got %lu\n",
+ "could not read data block -- expected %lu, got %lu\n",
(unsigned long) blkLen, (unsigned long) cnt);
ctx->filePos += blkLen;
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c
index 7c6f5c4128..ae3d9cc14a 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -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.48 2003/06/22 00:56:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.49 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,7 +45,7 @@ _parse_version(ArchiveHandle *AH, const char *versionString)
v = parse_version(versionString);
if (v < 0)
- die_horribly(AH, modulename, "unable to parse version string \"%s\"\n", versionString);
+ die_horribly(AH, modulename, "could not parse version string \"%s\"\n", versionString);
return v;
}
@@ -148,7 +148,7 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
else
newuser = (char *) requser;
- ahlog(AH, 1, "connecting to database %s as user %s\n", newdb, newuser);
+ ahlog(AH, 1, "connecting to database \"%s\" as user \"%s\"\n", newdb, newuser);
if (AH->requirePassword)
{
@@ -585,7 +585,7 @@ FixupBlobRefs(ArchiveHandle *AH, TocEntry *te)
res = PQexec(AH->blobConnection, tblQry->data);
if (!res)
- die_horribly(AH, modulename, "could not find oid columns of table \"%s\": %s",
+ die_horribly(AH, modulename, "could not find OID columns of table \"%s\": %s",
te->tag, PQerrorMessage(AH->connection));
if ((n = PQntuples(res)) == 0)
diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index 06734d7a46..11a5eb8f01 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.35 2003/03/20 03:34:56 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.36 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -374,7 +374,7 @@ tarOpen(ArchiveHandle *AH, const char *filename, char mode)
sprintf(fmode, "wb%d", AH->compression);
tm->zFH = gzdopen(dup(fileno(tm->tmpFH)), fmode);
if (tm->zFH == NULL)
- die_horribly(AH, modulename, "could not gzdopen temporary file\n");
+ die_horribly(AH, modulename, "could not open temporary file\n");
}
else
@@ -504,7 +504,7 @@ _tarReadRaw(ArchiveHandle *AH, void *buf, size_t len, TAR_MEMBER *th, FILE *fh)
res = fread(&((char *) buf)[used], 1, len, th->nFH);
}
else
- die_horribly(AH, modulename, "neither th nor fh specified in tarReadRaw() (internal error)\n");
+ die_horribly(AH, modulename, "internal error -- neither th nor fh specified in tarReadRaw()\n");
}
#if 0
@@ -636,7 +636,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
*/
if (strncmp(tmpCopy, "copy ", 5) != 0)
die_horribly(AH, modulename,
- "bad COPY statement - could not find \"copy\" in string \"%s\"\n", tmpCopy);
+ "invalid COPY statement -- could not find \"copy\" in string \"%s\"\n", tmpCopy);
pos1 = 5;
for (pos1 = 5; pos1 < strlen(tmpCopy); pos1++)
@@ -654,7 +654,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
if (pos2 >= strlen(tmpCopy))
die_horribly(AH, modulename,
- "bad COPY statement - could not find \"from stdin\" in string \"%s\" starting at position %lu\n",
+ "invalid COPY statement -- could not find \"from stdin\" in string \"%s\" starting at position %lu\n",
tmpCopy, (unsigned long) pos1);
ahwrite(tmpCopy, 1, pos2, AH); /* 'copy "table" [with oids]' */
@@ -1316,6 +1316,6 @@ _tarWriteHeader(TAR_MEMBER *th)
}
if (fwrite(h, 1, 512, th->tarFH) != 512)
- die_horribly(th->AH, modulename, "unable to write tar header\n");
+ die_horribly(th->AH, modulename, "could not write tar header\n");
}
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index c7e30d7c71..3bd2914588 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.335 2003/06/25 04:08:19 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.336 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -379,7 +379,7 @@ main(int argc, char **argv)
fprintf(stderr,
_("%s: invalid -X option -- %s\n"),
progname, optarg);
- fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
break;
@@ -393,17 +393,17 @@ main(int argc, char **argv)
break;
default:
- fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
}
if (optind < (argc - 1))
{
- fprintf(stderr,
- _("%s: too many command line options (first is '%s')\n"
- "Try '%s --help' for more information.\n"),
- progname, argv[optind + 1], progname);
+ fprintf(stderr, _("%s: too many command-line arguments (first is \"%s\")\n"),
+ progname, argv[optind + 1]);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
+ progname);
exit(1);
}
@@ -413,40 +413,40 @@ main(int argc, char **argv)
if (dataOnly && schemaOnly)
{
- write_msg(NULL, "The options \"schema only\" (-s) and \"data only\" (-a) cannot be used together.\n");
+ write_msg(NULL, "options \"schema only\" (-s) and \"data only\" (-a) cannot be used together\n");
exit(1);
}
if (dataOnly && outputClean)
{
- write_msg(NULL, "The options \"clean\" (-c) and \"data only\" (-a) cannot be used together.\n");
+ write_msg(NULL, "options \"clean\" (-c) and \"data only\" (-a) cannot be used together\n");
exit(1);
}
if (outputBlobs && selectTableName != NULL)
{
- write_msg(NULL, "Large object output is not supported for a single table.\n");
- write_msg(NULL, "Use a full dump instead.\n");
+ write_msg(NULL, "large-object output not supported for a single table\n");
+ write_msg(NULL, "use a full dump instead\n");
exit(1);
}
if (outputBlobs && selectSchemaName != NULL)
{
- write_msg(NULL, "Large object output is not supported for a single schema.\n");
- write_msg(NULL, "Use a full dump instead.\n");
+ write_msg(NULL, "large-object output not supported for a single schema\n");
+ write_msg(NULL, "use a full dump instead\n");
exit(1);
}
if (dumpData == true && oids == true)
{
- write_msg(NULL, "INSERT (-d, -D) and OID (-o) options cannot be used together.\n");
+ write_msg(NULL, "INSERT (-d, -D) and OID (-o) options cannot be used together\n");
write_msg(NULL, "(The INSERT command cannot set OIDs.)\n");
exit(1);
}
if (outputBlobs == true && (format[0] == 'p' || format[0] == 'P'))
{
- write_msg(NULL, "large object output is not supported for plain text dump files.\n");
+ write_msg(NULL, "large-object output is not supported for plain-text dump files\n");
write_msg(NULL, "(Use a different output format.)\n");
exit(1);
}
@@ -482,7 +482,7 @@ main(int argc, char **argv)
if (g_fout == NULL)
{
- write_msg(NULL, "could not open output file %s for writing\n", filename);
+ write_msg(NULL, "could not open output file \"%s\" for writing\n", filename);
exit(1);
}
@@ -493,7 +493,7 @@ main(int argc, char **argv)
g_fout->maxRemoteVersion = parse_version(PG_VERSION);
if (g_fout->maxRemoteVersion < 0)
{
- write_msg(NULL, "unable to parse version string \"%s\"\n", PG_VERSION);
+ write_msg(NULL, "could not parse version string \"%s\"\n", PG_VERSION);
exit(1);
}
@@ -679,7 +679,7 @@ help(const char *progname)
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
- printf(_("\nIf no database name is not supplied, then the PGDATABASE environment\n"
+ printf(_("\nIf no database name is supplied, then the PGDATABASE environment\n"
"variable value is used.\n\n"));
printf(_("Report bugs to <pgsql-bugs@postgresql.org>.\n"));
}
@@ -1420,7 +1420,7 @@ getNamespaces(int *numNamespaces)
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to obtain list of namespaces failed: %s", PQerrorMessage(g_conn));
+ write_msg(NULL, "query to obtain list of schemas failed: %s", PQerrorMessage(g_conn));
exit_nicely();
}
@@ -1444,7 +1444,7 @@ getNamespaces(int *numNamespaces)
selectDumpableNamespace(&nsinfo[i]);
if (strlen(nsinfo[i].usename) == 0)
- write_msg(NULL, "WARNING: owner of namespace %s appears to be invalid\n",
+ write_msg(NULL, "WARNING: owner of schema \"%s\" appears to be invalid\n",
nsinfo[i].nspname);
}
@@ -1461,7 +1461,7 @@ getNamespaces(int *numNamespaces)
/* Didn't find a match */
if (i == ntups)
{
- write_msg(NULL, "Specified schema \"%s\" does not exist.\n",
+ write_msg(NULL, "specified schema \"%s\" does not exist\n",
selectSchemaName);
exit_nicely();
}
@@ -1498,7 +1498,7 @@ findNamespace(const char *nsoid, const char *objoid)
if (strcmp(nsoid, nsinfo->oid) == 0)
return nsinfo;
}
- write_msg(NULL, "could not find namespace with OID %s\n", nsoid);
+ write_msg(NULL, "schema with OID %s does not exist\n", nsoid);
exit_nicely();
}
else
@@ -1623,7 +1623,7 @@ getTypes(int *numTypes)
tinfo[i].isDefined = false;
if (strlen(tinfo[i].usename) == 0 && tinfo[i].isDefined)
- write_msg(NULL, "WARNING: owner of data type %s appears to be invalid\n",
+ write_msg(NULL, "WARNING: owner of data type \"%s\" appears to be invalid\n",
tinfo[i].typname);
}
@@ -2255,7 +2255,7 @@ getTables(int *numTables)
lres = PQexec(g_conn, lockquery->data);
if (!lres || PQresultStatus(lres) != PGRES_COMMAND_OK)
{
- write_msg(NULL, "Attempt to lock table \"%s\" failed. %s",
+ write_msg(NULL, "attempt to lock table \"%s\" failed: %s",
tblinfo[i].relname, PQerrorMessage(g_conn));
exit_nicely();
}
@@ -2283,7 +2283,7 @@ getTables(int *numTables)
/* Didn't find a match */
if (i == ntups)
{
- write_msg(NULL, "Specified table \"%s\" does not exist.\n",
+ write_msg(NULL, "specified table \"%s\" does not exist\n",
selectTableName);
exit_nicely();
}
@@ -2414,7 +2414,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
* pg_attribute_relid_attnum_index.
*/
if (g_verbose)
- write_msg(NULL, "finding the columns and types of table %s\n",
+ write_msg(NULL, "finding the columns and types of table \"%s\"\n",
tbinfo->relname);
resetPQExpBuffer(q);
@@ -2527,7 +2527,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
int numDefaults;
if (g_verbose)
- write_msg(NULL, "finding DEFAULT expressions of table %s\n",
+ write_msg(NULL, "finding default expressions of table \"%s\"\n",
tbinfo->relname);
resetPQExpBuffer(q);
@@ -2570,7 +2570,7 @@ getTableAttrs(TableInfo *tblinfo, int numTables)
if (adnum <= 0 || adnum > ntups)
{
- write_msg(NULL, "invalid adnum value %d for table %s\n",
+ write_msg(NULL, "invalid adnum value %d for table \"%s\"\n",
adnum, tbinfo->relname);
exit_nicely();
}
@@ -2687,7 +2687,7 @@ dumpComment(Archive *fout, const char *target,
res = PQexec(g_conn, query->data);
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to get comment on oid %s failed: %s",
+ write_msg(NULL, "query to get comment on OID %s failed: %s",
oid, PQerrorMessage(g_conn));
exit_nicely();
}
@@ -2854,7 +2854,7 @@ dumpDBComment(Archive *fout)
res = PQexec(g_conn, query->data);
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to get database oid failed: %s",
+ write_msg(NULL, "query to get database OID failed: %s",
PQerrorMessage(g_conn));
exit_nicely();
}
@@ -3051,7 +3051,7 @@ dumpOneBaseType(Archive *fout, TypeInfo *tinfo,
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to obtain information on type %s failed: %s",
+ write_msg(NULL, "query to obtain information on data type \"%s\" failed: %s",
tinfo->typname, PQerrorMessage(g_conn));
exit_nicely();
}
@@ -3397,7 +3397,7 @@ dumpOneCompositeType(Archive *fout, TypeInfo *tinfo)
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to obtain type information failed: %s", PQerrorMessage(g_conn));
+ write_msg(NULL, "query to obtain data type information failed: %s", PQerrorMessage(g_conn));
exit_nicely();
}
@@ -3405,7 +3405,7 @@ dumpOneCompositeType(Archive *fout, TypeInfo *tinfo)
ntups = PQntuples(res);
if (ntups < 1)
{
- write_msg(NULL, "Got no rows from: %s", query->data);
+ write_msg(NULL, "query yielded no rows: %s\n", query->data);
exit_nicely();
}
@@ -3571,7 +3571,7 @@ dumpProcLangs(Archive *fout, FuncInfo finfo[], int numFuncs)
fidx = findFuncByOid(finfo, numFuncs, lanplcallfoid);
if (fidx < 0)
{
- write_msg(NULL, "handler procedure for procedural language %s not found\n",
+ write_msg(NULL, "handler procedure for procedural language \"%s\" not found\n",
lanname);
exit_nicely();
}
@@ -3581,7 +3581,7 @@ dumpProcLangs(Archive *fout, FuncInfo finfo[], int numFuncs)
vidx = findFuncByOid(finfo, numFuncs, lanvalidator);
if (vidx < 0)
{
- write_msg(NULL, "validator procedure for procedural language %s not found\n",
+ write_msg(NULL, "validator procedure for procedural language \"%s\" not found\n",
lanname);
exit_nicely();
}
@@ -3799,7 +3799,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo)
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to obtain information on function %s failed: %s",
+ write_msg(NULL, "query to obtain information on function \"%s\" failed: %s",
finfo->proname, PQerrorMessage(g_conn));
exit_nicely();
}
@@ -3875,7 +3875,7 @@ dumpOneFunc(Archive *fout, FuncInfo *finfo)
appendPQExpBuffer(q, " STABLE");
else if (provolatile[0] != PROVOLATILE_VOLATILE)
{
- write_msg(NULL, "Unexpected provolatile value for function %s\n",
+ write_msg(NULL, "unrecognized provolatile value for function \"%s\"\n",
finfo->proname);
exit_nicely();
}
@@ -4932,7 +4932,7 @@ dumpACL(Archive *fout, const char *type, const char *name,
if (!buildACLCommands(name, type, acls, owner, fout->remoteVersion, sql))
{
- write_msg(NULL, "could not parse ACL list (%s) for object %s (%s)\n",
+ write_msg(NULL, "could not parse ACL list (%s) for object \"%s\" (%s)\n",
acls, name, type);
exit_nicely();
}
@@ -5113,7 +5113,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
if (PQgetisnull(res, 0, 1))
{
- write_msg(NULL, "query to obtain definition of view \"%s\" returned NULL oid\n",
+ write_msg(NULL, "query to obtain definition of view \"%s\" returned null OID\n",
tbinfo->relname);
exit_nicely();
}
@@ -5260,7 +5260,7 @@ dumpOneTable(Archive *fout, TableInfo *tbinfo, TableInfo *g_tblinfo)
int ntups2;
if (g_verbose)
- write_msg(NULL, "finding CHECK constraints for table %s\n",
+ write_msg(NULL, "finding check constraints for table \"%s\"\n",
tbinfo->relname);
resetPQExpBuffer(query);
@@ -5487,7 +5487,7 @@ getAttrName(int attrnum, TableInfo *tblInfo)
case TableOidAttributeNumber:
return "tableoid";
}
- write_msg(NULL, "getAttrName(): invalid column number %d for table %s\n",
+ write_msg(NULL, "invalid column number %d for table \"%s\"\n",
attrnum, tblInfo->relname);
exit_nicely();
return NULL; /* keep compiler quiet */
@@ -5748,7 +5748,7 @@ setMaxOid(Archive *fout)
max_oid = PQoidValue(res);
if (max_oid == 0)
{
- write_msg(NULL, "inserted invalid oid\n");
+ write_msg(NULL, "inserted invalid OID\n");
exit_nicely();
}
PQclear(res);
@@ -5761,7 +5761,7 @@ setMaxOid(Archive *fout)
}
PQclear(res);
if (g_verbose)
- write_msg(NULL, "maximum system oid is %u\n", max_oid);
+ write_msg(NULL, "maximum system OID is %u\n", max_oid);
snprintf(sql, sizeof(sql),
"CREATE TEMPORARY TABLE pgdump_oid (dummy integer);\n"
"COPY pgdump_oid WITH OIDS FROM stdin;\n"
@@ -5798,7 +5798,7 @@ findLastBuiltinOid_V71(const char *dbname)
if (res == NULL ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "error in finding the last system oid: %s", PQerrorMessage(g_conn));
+ write_msg(NULL, "error in finding the last system OID: %s", PQerrorMessage(g_conn));
exit_nicely();
}
ntups = PQntuples(res);
@@ -5843,12 +5843,12 @@ findLastBuiltinOid_V70(void)
ntups = PQntuples(res);
if (ntups < 1)
{
- write_msg(NULL, "could not find template1 database entry in the pg_database table\n");
+ write_msg(NULL, "could not find entry for database template1 in table pg_database\n");
exit_nicely();
}
if (ntups > 1)
{
- write_msg(NULL, "found more than one template1 database entry in the pg_database table\n");
+ write_msg(NULL, "found more than one entry for database template1 in table pg_database\n");
exit_nicely();
}
last_oid = atooid(PQgetvalue(res, 0, PQfnumber(res, "oid")));
@@ -6051,7 +6051,7 @@ dumpConstraints(Archive *fout, TableInfo *tblinfo, int numTables)
continue;
if (g_verbose)
- write_msg(NULL, "dumping foreign key constraints for table %s\n",
+ write_msg(NULL, "dumping foreign key constraints for table \"%s\"\n",
tbinfo->relname);
/*
@@ -6162,7 +6162,7 @@ dumpTriggers(Archive *fout, TableInfo *tblinfo, int numTables)
continue;
if (g_verbose)
- write_msg(NULL, "dumping triggers for table %s\n",
+ write_msg(NULL, "dumping triggers for table \"%s\"\n",
tbinfo->relname);
/*
@@ -6332,7 +6332,7 @@ dumpTriggers(Archive *fout, TableInfo *tblinfo, int numTables)
if (PQgetisnull(res, j, i_tgconstrrelname))
{
- write_msg(NULL, "query produced NULL referenced table name for foreign key trigger \"%s\" on table \"%s\" (oid of table: %s)\n",
+ write_msg(NULL, "query produced null referenced table name for foreign key trigger \"%s\" on table \"%s\" (OID of table: %s)\n",
tgname, tbinfo->relname, tgconstrrelid);
exit_nicely();
}
@@ -6376,7 +6376,7 @@ dumpTriggers(Archive *fout, TableInfo *tblinfo, int numTables)
p = strchr(p, '\\');
if (p == NULL)
{
- write_msg(NULL, "bad argument string (%s) for trigger \"%s\" on table \"%s\"\n",
+ write_msg(NULL, "invalid argument string (%s) for trigger \"%s\" on table \"%s\"\n",
PQgetvalue(res, j, i_tgargs),
tgname,
tbinfo->relname);
@@ -6582,7 +6582,7 @@ selectSourceSchema(const char *schemaName)
if (!res ||
PQresultStatus(res) != PGRES_COMMAND_OK)
{
- write_msg(NULL, "query to set search_path failed: %s",
+ write_msg(NULL, "command to set search_path failed: %s",
PQerrorMessage(g_conn));
exit_nicely();
}
@@ -6644,7 +6644,7 @@ getFormattedTypeName(const char *oid, OidOptions opts)
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK)
{
- write_msg(NULL, "query to obtain name of type %s failed: %s",
+ write_msg(NULL, "query to obtain name of data type %s failed: %s",
oid, PQerrorMessage(g_conn));
exit_nicely();
}
@@ -6653,7 +6653,7 @@ getFormattedTypeName(const char *oid, OidOptions opts)
ntups = PQntuples(res);
if (ntups != 1)
{
- write_msg(NULL, "Got %d rows instead of one from: %s",
+ write_msg(NULL, "query yielded %d rows instead of one: %s\n",
ntups, query->data);
exit_nicely();
}
diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c
index ad368a56ae..e56f2448fc 100644
--- a/src/bin/pg_dump/pg_dumpall.c
+++ b/src/bin/pg_dump/pg_dumpall.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.22 2003/06/22 00:56:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.23 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -189,17 +189,17 @@ main(int argc, char *argv[])
break;
default:
- fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
}
if (optind < argc)
{
- fprintf(stderr,
- _("%s: too many command line options (first is '%s')\n"
- "Try '%s --help' for more information.\n"),
- progname, argv[optind], progname);
+ fprintf(stderr, _("%s: too many command-line arguments (first is \"%s\")\n"),
+ progname, argv[optind]);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
+ progname);
exit(1);
}
@@ -494,7 +494,7 @@ dumpCreateDB(PGconn *conn)
!buildACLCommands(fdbname, "DATABASE", dbacl, dbowner,
server_version, buf))
{
- fprintf(stderr, _("%s: could not parse ACL list (%s) for database %s\n"),
+ fprintf(stderr, _("%s: could not parse ACL list (%s) for database \"%s\"\n"),
progname, dbacl, fdbname);
PQfinish(conn);
exit(1);
@@ -641,7 +641,7 @@ dumpDatabases(PGconn *conn)
ret = runPgDump(dbname);
if (ret != 0)
{
- fprintf(stderr, _("%s: pg_dump failed on %s, exiting\n"), progname, dbname);
+ fprintf(stderr, _("%s: pg_dump failed on database \"%s\", exiting\n"), progname, dbname);
exit(1);
}
}
@@ -676,7 +676,7 @@ runPgDump(const char *dbname)
appendPQExpBufferChar(cmd, '\'');
if (verbose)
- fprintf(stderr, _("%s: running %s\n"), progname, cmd->data);
+ fprintf(stderr, _("%s: running \"%s\"\n"), progname, cmd->data);
fflush(stdout);
fflush(stderr);
@@ -717,7 +717,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
if (!conn)
{
- fprintf(stderr, _("%s: could not connect to database %s\n"),
+ fprintf(stderr, _("%s: could not connect to database \"%s\"\n"),
progname, dbname);
exit(1);
}
@@ -740,7 +740,7 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
/* check to see that the backend connection was successfully made */
if (PQstatus(conn) == CONNECTION_BAD)
{
- fprintf(stderr, _("%s: could not connect to database %s: %s\n"),
+ fprintf(stderr, _("%s: could not connect to database \"%s\": %s\n"),
progname, dbname, PQerrorMessage(conn));
exit(1);
}
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index be4fac3571..0a7b0f1d3b 100644
--- a/src/bin/pg_dump/pg_restore.c
+++ b/src/bin/pg_dump/pg_restore.c
@@ -34,7 +34,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.47 2003/06/11 16:29:42 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.48 2003/07/23 08:47:30 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -273,7 +273,7 @@ main(int argc, char **argv)
fprintf(stderr,
_("%s: invalid -X option -- %s\n"),
progname, optarg);
- fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
break;
@@ -283,7 +283,7 @@ main(int argc, char **argv)
break;
default:
- fprintf(stderr, _("Try '%s --help' for more information.\n"), progname);
+ fprintf(stderr, _("Try \"%s --help\" for more information.\n"), progname);
exit(1);
}
}