- 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"'
This commit is contained in:
parent
31b5c05819
commit
cfeccdf80a
@ -15,6 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
@ -186,7 +187,7 @@ void RestoreArchive(Archive* AHX, RestoreOptions *ropt)
|
|||||||
if (impliedDataOnly)
|
if (impliedDataOnly)
|
||||||
{
|
{
|
||||||
ropt->dataOnly = impliedDataOnly;
|
ropt->dataOnly = impliedDataOnly;
|
||||||
ahlog(AH, 1, "Implied data-only restore\n", te->desc, te->name);
|
ahlog(AH, 1, "Implied data-only restore\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* 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_MAJOR 1
|
||||||
#define K_VERS_MINOR 4
|
#define K_VERS_MINOR 4
|
||||||
#define K_VERS_REV 29
|
#define K_VERS_REV 30
|
||||||
|
|
||||||
/* Data block types */
|
/* Data block types */
|
||||||
#define BLK_DATA 1
|
#define BLK_DATA 1
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
@ -5,11 +5,18 @@
|
|||||||
* Implements the basic DB functions used by the archiver.
|
* Implements the basic DB functions used by the archiver.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 04-Jan-2001 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
* - Check results of PQ routines more carefully.
|
* - 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;
|
int i, n;
|
||||||
char *attr;
|
char *attr;
|
||||||
|
|
||||||
for(i=0 ; i < strlen(tablename) ; i++)
|
|
||||||
tablename[i] = tolower((unsigned char) tablename[i]);
|
|
||||||
|
|
||||||
if (strcmp(tablename, BLOB_XREF_TABLE) == 0)
|
if (strcmp(tablename, BLOB_XREF_TABLE) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Definitions for pg_backup_db.c
|
* 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 */
|
#define BLOB_XREF_TABLE "dump_blob_xref" /* MUST be lower case */
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 09-Jul-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
@ -1,25 +1,26 @@
|
|||||||
/* Header
|
/*
|
||||||
Offset Length Contents
|
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_tar.h,v 1.2 2001/03/19 02:35:29 pjw Exp $
|
||||||
0 100 bytes File name ('\0' terminated, 99 maxmum length)
|
*
|
||||||
100 8 bytes File mode (in octal ascii)
|
* TAR Header
|
||||||
108 8 bytes User ID (in octal ascii)
|
*
|
||||||
116 8 bytes Group ID (in octal ascii)
|
* Offset Length Contents
|
||||||
124 12 bytes File size (s) (in octal ascii)
|
* 0 100 bytes File name ('\0' terminated, 99 maxmum length)
|
||||||
136 12 bytes Modify time (in octal ascii)
|
* 100 8 bytes File mode (in octal ascii)
|
||||||
148 8 bytes Header checksum (in octal ascii)
|
* 108 8 bytes User ID (in octal ascii)
|
||||||
156 1 bytes Link flag
|
* 116 8 bytes Group ID (in octal ascii)
|
||||||
157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
|
* 124 12 bytes File size (s) (in octal ascii)
|
||||||
257 8 bytes Magic ("ustar \0")
|
* 136 12 bytes Modify time (in octal ascii)
|
||||||
265 32 bytes User name ('\0' terminated, 31 maxmum length)
|
* 148 8 bytes Header checksum (in octal ascii)
|
||||||
297 32 bytes Group name ('\0' terminated, 31 maxmum length)
|
* 156 1 bytes Link flag
|
||||||
329 8 bytes Major device ID (in octal ascii)
|
* 157 100 bytes Linkname ('\0' terminated, 99 maxmum length)
|
||||||
337 8 bytes Minor device ID (in octal ascii)
|
* 257 8 bytes Magic ("ustar \0")
|
||||||
345 167 bytes Padding
|
* 265 32 bytes User name ('\0' terminated, 31 maxmum length)
|
||||||
512 (s+p)bytes File contents (s+p) := (((s) + 511) & ~511), round up to 512 bytes
|
* 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 */
|
/* The linkflag defines the type of file */
|
||||||
#define LF_OLDNORMAL '\0' /* Normal disk file, Unix compatible */
|
#define LF_OLDNORMAL '\0' /* Normal disk file, Unix compatible */
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
|
||||||
*
|
*
|
||||||
@ -108,7 +108,13 @@
|
|||||||
* I opted for encoding them except in procedure bodies.
|
* I opted for encoding them except in procedure bodies.
|
||||||
* - Dump relevant parts of sequences only when doing schemaOnly & dataOnly
|
* - Dump relevant parts of sequences only when doing schemaOnly & dataOnly
|
||||||
* - Prevent double-dumping of sequences when 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;
|
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,
|
"TABLE DATA", NULL, "", "", copyStmt, tblinfo[i].usename,
|
||||||
dumpFn, dumpCtx);
|
dumpFn, dumpCtx);
|
||||||
}
|
}
|
||||||
@ -2972,7 +2978,7 @@ dumpTypes(Archive *fout, FuncInfo *finfo, int numFuncs,
|
|||||||
else
|
else
|
||||||
appendPQExpBuffer(q, ");\n");
|
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);
|
q->data, delq->data, "", tinfo[i].usename, NULL, NULL);
|
||||||
|
|
||||||
/*** Dump Type Comments ***/
|
/*** Dump Type Comments ***/
|
||||||
@ -3841,7 +3847,7 @@ dumpTables(Archive *fout, TableInfo *tblinfo, int numTables,
|
|||||||
|
|
||||||
if (!dataOnly) {
|
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,
|
reltypename, NULL, q->data, delq->data, "", tblinfo[i].usename,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
@ -4374,7 +4380,7 @@ dumpSequence(Archive *fout, TableInfo tbinfo, const bool schemaOnly, const bool
|
|||||||
incby, maxv, minv, cache,
|
incby, maxv, minv, cache,
|
||||||
(cycled == 't') ? "cycle" : "");
|
(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);
|
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);
|
formatStringLiteral(query, fmtId(tbinfo.relname, force_quotes), CONV_ALL);
|
||||||
appendPQExpBuffer(query, ", %d, '%c');\n", last, called);
|
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);
|
query->data, "" /* Del */, "", "", NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user