From cfeccdf80a6fd214f22a13d12a237096ed77e23f Mon Sep 17 00:00:00 2001 From: Philip Warner Date: Mon, 19 Mar 2001 02:35:29 +0000 Subject: [PATCH] - Added CVS headers to files - Avoid forcing table name to lower case in FixupBlobXrefs - Removed fmtId calls for all ArchiveEntry name fields. This fixes quoting problems in trigger enable/disable code for mixed case table names, and avoids commands like 'pg_restore -t '"TblA"' --- src/bin/pg_dump/pg_backup.h | 1 + src/bin/pg_dump/pg_backup_archiver.c | 3 +- src/bin/pg_dump/pg_backup_archiver.h | 3 +- src/bin/pg_dump/pg_backup_custom.c | 1 + src/bin/pg_dump/pg_backup_db.c | 10 +++++-- src/bin/pg_dump/pg_backup_db.h | 2 ++ src/bin/pg_dump/pg_backup_files.c | 1 + src/bin/pg_dump/pg_backup_null.c | 1 + src/bin/pg_dump/pg_backup_tar.c | 1 + src/bin/pg_dump/pg_backup_tar.h | 45 ++++++++++++++-------------- src/bin/pg_dump/pg_dump.c | 20 ++++++++----- src/bin/pg_dump/pg_restore.c | 1 + 12 files changed, 55 insertions(+), 34 deletions(-) diff --git a/src/bin/pg_dump/pg_backup.h b/src/bin/pg_dump/pg_backup.h index ae04c7c2ea..6593a7e56f 100644 --- a/src/bin/pg_dump/pg_backup.h +++ b/src/bin/pg_dump/pg_backup.h @@ -15,6 +15,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup.h,v 1.8 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index 51f0aff0aa..cd0fd9c312 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -15,6 +15,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.21 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * @@ -186,7 +187,7 @@ void RestoreArchive(Archive* AHX, RestoreOptions *ropt) if (impliedDataOnly) { ropt->dataOnly = impliedDataOnly; - ahlog(AH, 1, "Implied data-only restore\n", te->desc, te->name); + ahlog(AH, 1, "Implied data-only restore\n"); } } diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h index bb926d6e6f..fdf70f716f 100644 --- a/src/bin/pg_dump/pg_backup_archiver.h +++ b/src/bin/pg_dump/pg_backup_archiver.h @@ -17,6 +17,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.26 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * @@ -62,7 +63,7 @@ typedef z_stream *z_streamp; #define K_VERS_MAJOR 1 #define K_VERS_MINOR 4 -#define K_VERS_REV 29 +#define K_VERS_REV 30 /* Data block types */ #define BLK_DATA 1 diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c index 4fe74a1bc6..e9117b8320 100644 --- a/src/bin/pg_dump/pg_backup_custom.c +++ b/src/bin/pg_dump/pg_backup_custom.c @@ -19,6 +19,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.8 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index a3de94df81..3e3976bc74 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -5,11 +5,18 @@ * Implements the basic DB functions used by the archiver. * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.15 2001/03/19 02:35:28 pjw Exp $ + * + * NOTES * * Modifications - 04-Jan-2001 - pjw@rhyme.com.au * * - Check results of PQ routines more carefully. * + * Modifications - 19-Mar-2001 - pjw@rhyme.com.au + * + * - Avoid forcing table name to lower case in FixupBlobXrefs! + * *------------------------------------------------------------------------- */ @@ -583,9 +590,6 @@ void FixupBlobRefs(ArchiveHandle *AH, char *tablename) int i, n; char *attr; - for(i=0 ; i < strlen(tablename) ; i++) - tablename[i] = tolower((unsigned char) tablename[i]); - if (strcmp(tablename, BLOB_XREF_TABLE) == 0) return; diff --git a/src/bin/pg_dump/pg_backup_db.h b/src/bin/pg_dump/pg_backup_db.h index 3dfc6664fc..d7903d2bcd 100644 --- a/src/bin/pg_dump/pg_backup_db.h +++ b/src/bin/pg_dump/pg_backup_db.h @@ -1,6 +1,8 @@ /* * Definitions for pg_backup_db.c * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.h,v 1.3 2001/03/19 02:35:28 pjw Exp $ */ #define BLOB_XREF_TABLE "dump_blob_xref" /* MUST be lower case */ diff --git a/src/bin/pg_dump/pg_backup_files.c b/src/bin/pg_dump/pg_backup_files.c index 632004ead4..d4746a966a 100644 --- a/src/bin/pg_dump/pg_backup_files.c +++ b/src/bin/pg_dump/pg_backup_files.c @@ -20,6 +20,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_files.c,v 1.7 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c index 761d2ea446..96232f5734 100644 --- a/src/bin/pg_dump/pg_backup_null.c +++ b/src/bin/pg_dump/pg_backup_null.c @@ -17,6 +17,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_null.c,v 1.4 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 09-Jul-2000 - pjw@rhyme.com.au * diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c index a24701a37c..76d1e6c743 100644 --- a/src/bin/pg_dump/pg_backup_tar.c +++ b/src/bin/pg_dump/pg_backup_tar.c @@ -16,6 +16,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.c,v 1.11 2001/03/19 02:35:28 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * diff --git a/src/bin/pg_dump/pg_backup_tar.h b/src/bin/pg_dump/pg_backup_tar.h index 9ae150b4b5..d53de29098 100644 --- a/src/bin/pg_dump/pg_backup_tar.h +++ b/src/bin/pg_dump/pg_backup_tar.h @@ -1,25 +1,26 @@ -/* Header -Offset Length Contents - 0 100 bytes File name ('\0' terminated, 99 maxmum length) -100 8 bytes File mode (in octal ascii) -108 8 bytes User ID (in octal ascii) -116 8 bytes Group ID (in octal ascii) -124 12 bytes File size (s) (in octal ascii) -136 12 bytes Modify time (in octal ascii) -148 8 bytes Header checksum (in octal ascii) -156 1 bytes Link flag -157 100 bytes Linkname ('\0' terminated, 99 maxmum length) -257 8 bytes Magic ("ustar \0") -265 32 bytes User name ('\0' terminated, 31 maxmum length) -297 32 bytes Group name ('\0' terminated, 31 maxmum length) -329 8 bytes Major device ID (in octal ascii) -337 8 bytes Minor device ID (in octal ascii) -345 167 bytes Padding -512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511), round up to 512 bytes -*/ - - - +/* + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.h,v 1.2 2001/03/19 02:35:29 pjw Exp $ + * + * TAR Header + * + * Offset Length Contents + * 0 100 bytes File name ('\0' terminated, 99 maxmum length) + * 100 8 bytes File mode (in octal ascii) + * 108 8 bytes User ID (in octal ascii) + * 116 8 bytes Group ID (in octal ascii) + * 124 12 bytes File size (s) (in octal ascii) + * 136 12 bytes Modify time (in octal ascii) + * 148 8 bytes Header checksum (in octal ascii) + * 156 1 bytes Link flag + * 157 100 bytes Linkname ('\0' terminated, 99 maxmum length) + * 257 8 bytes Magic ("ustar \0") + * 265 32 bytes User name ('\0' terminated, 31 maxmum length) + * 297 32 bytes Group name ('\0' terminated, 31 maxmum length) + * 329 8 bytes Major device ID (in octal ascii) + * 337 8 bytes Minor device ID (in octal ascii) + * 345 167 bytes Padding + * 512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511), round up to 512 bytes + */ /* The linkflag defines the type of file */ #define LF_OLDNORMAL '\0' /* Normal disk file, Unix compatible */ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 84e53f2744..c612937836 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.194 2001/03/06 04:53:28 pjw Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.195 2001/03/19 02:35:29 pjw Exp $ * * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * @@ -108,7 +108,13 @@ * I opted for encoding them except in procedure bodies. * - Dump relevant parts of sequences only when doing schemaOnly & dataOnly * - Prevent double-dumping of sequences when dataOnly. - * + * + * Modifications - 19-Mar-2001 - pjw@rhyme.com.au + * + * - Remove fmtId calls for all ArchiveEntry name fields. This fixes + * quoting problems in trigger enable/disable code for mixed case + * table names, and avoids commands like 'pg_restore -t '"TblA"'' + * *------------------------------------------------------------------------- */ @@ -649,7 +655,7 @@ dumpClasses(const TableInfo *tblinfo, const int numTables, Archive *fout, copyStmt = NULL; } - ArchiveEntry(fout, tblinfo[i].oid, fmtId(tblinfo[i].relname, false), + ArchiveEntry(fout, tblinfo[i].oid, tblinfo[i].relname, "TABLE DATA", NULL, "", "", copyStmt, tblinfo[i].usename, dumpFn, dumpCtx); } @@ -2972,7 +2978,7 @@ dumpTypes(Archive *fout, FuncInfo *finfo, int numFuncs, else appendPQExpBuffer(q, ");\n"); - ArchiveEntry(fout, tinfo[i].oid, fmtId(tinfo[i].typname, force_quotes), "TYPE", NULL, + ArchiveEntry(fout, tinfo[i].oid, tinfo[i].typname, "TYPE", NULL, q->data, delq->data, "", tinfo[i].usename, NULL, NULL); /*** Dump Type Comments ***/ @@ -3841,7 +3847,7 @@ dumpTables(Archive *fout, TableInfo *tblinfo, int numTables, if (!dataOnly) { - ArchiveEntry(fout, tblinfo[i].oid, fmtId(tblinfo[i].relname, false), + ArchiveEntry(fout, tblinfo[i].oid, tblinfo[i].relname, reltypename, NULL, q->data, delq->data, "", tblinfo[i].usename, NULL, NULL); @@ -4374,7 +4380,7 @@ dumpSequence(Archive *fout, TableInfo tbinfo, const bool schemaOnly, const bool incby, maxv, minv, cache, (cycled == 't') ? "cycle" : ""); - ArchiveEntry(fout, tbinfo.oid, fmtId(tbinfo.relname, force_quotes), "SEQUENCE", NULL, + ArchiveEntry(fout, tbinfo.oid, tbinfo.relname, "SEQUENCE", NULL, query->data, delqry->data, "", tbinfo.usename, NULL, NULL); } @@ -4385,7 +4391,7 @@ dumpSequence(Archive *fout, TableInfo tbinfo, const bool schemaOnly, const bool formatStringLiteral(query, fmtId(tbinfo.relname, force_quotes), CONV_ALL); appendPQExpBuffer(query, ", %d, '%c');\n", last, called); - ArchiveEntry(fout, tbinfo.oid, fmtId(tbinfo.relname, force_quotes), "SEQUENCE SET", NULL, + ArchiveEntry(fout, tbinfo.oid, tbinfo.relname, "SEQUENCE SET", NULL, query->data, "" /* Del */, "", "", NULL, NULL); } diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c index 7aad8b6cc6..073930c23f 100644 --- a/src/bin/pg_dump/pg_restore.c +++ b/src/bin/pg_dump/pg_restore.c @@ -34,6 +34,7 @@ * * * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.18 2001/03/19 02:35:29 pjw Exp $ * * Modifications - 28-Jun-2000 - pjw@rhyme.com.au * -- 2.40.0