summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-11-05 17:46:40 +0000
committerBruce Momjian <bruce@momjian.us>2001-11-05 17:46:40 +0000
commitea08e6cd5542cb269ecd3e735f1dfa3bb61fbc4f (patch)
treebf6b60c08be3ddf5a40e110e8276dc2d45b1431c /src/bin/pg_dump
parent34153b205265e2e831c1e3ee02be0fc88fa41710 (diff)
downloadpostgresql-ea08e6cd5542cb269ecd3e735f1dfa3bb61fbc4f.tar.gz
New pgindent run with fixes suggested by Tom. Patch manually reviewed,
initdb/regression tests pass.
Diffstat (limited to 'src/bin/pg_dump')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c37
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.h4
-rw-r--r--src/bin/pg_dump/pg_dump.h4
-rw-r--r--src/bin/pg_dump/pg_restore.c4
4 files changed, 28 insertions, 21 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 07f4ad8a4d..939556a572 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.36 2001/11/04 04:05:36 pjw Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.37 2001/11/05 17:46:30 momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
@@ -59,7 +59,7 @@
*
* Modifications - 01-Nov-2001 - pjw@rhyme.com.au
* - Fix handling of {data/schema}-only restores when using a full
- * backup file; prior version was restoring schema in data-only
+ * backup file; prior version was restoring schema in data-only
* restores. Added enum to make code easier to understand.
*
*-------------------------------------------------------------------------
@@ -75,10 +75,11 @@
#include "pqexpbuffer.h"
#include "libpq/libpq-fs.h"
-typedef enum _teReqs_ {
+typedef enum _teReqs_
+{
REQ_SCHEMA = 1,
- REQ_DATA = 2,
- REQ_ALL = REQ_SCHEMA + REQ_DATA
+ REQ_DATA = 2,
+ REQ_ALL = REQ_SCHEMA + REQ_DATA
} teReqs;
static void _SortToc(ArchiveHandle *AH, TocSortCompareFn fn);
@@ -91,7 +92,7 @@ static int _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt,
static void _reconnectAsOwner(ArchiveHandle *AH, const char *dbname, TocEntry *te);
static void _reconnectAsUser(ArchiveHandle *AH, const char *dbname, const char *user);
-static teReqs _tocEntryRequired(TocEntry *te, RestoreOptions *ropt);
+static teReqs _tocEntryRequired(TocEntry *te, RestoreOptions *ropt);
static void _disableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt);
static void _enableTriggersIfNecessary(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt);
static TocEntry *_getTocEntry(ArchiveHandle *AH, int id);
@@ -426,7 +427,7 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
reqs = _tocEntryRequired(te, ropt);
- if ((reqs & REQ_DATA) != 0) /* We loaded the data */
+ if ((reqs & REQ_DATA) != 0) /* We loaded the data */
{
ahlog(AH, 1, "fixing up large object cross-reference for %s\n", te->name);
FixupBlobRefs(AH, te->name);
@@ -1854,7 +1855,7 @@ ReadToc(ArchiveHandle *AH)
static teReqs
_tocEntryRequired(TocEntry *te, RestoreOptions *ropt)
{
- teReqs res = 3; /* Schema = 1, Data = 2, Both = 3 */
+ teReqs res = 3; /* Schema = 1, Data = 2, Both = 3 */
/* If it's an ACL, maybe ignore it */
if (ropt->aclsSkip && strcmp(te->desc, "ACL") == 0)
@@ -1898,14 +1899,20 @@ _tocEntryRequired(TocEntry *te, RestoreOptions *ropt)
return 0;
}
- /* Check if we had a dataDumper. Indicates if the entry is schema or data */
- if (!te->hadDumper) {
- /* Special Case: If 'SEQUENCE SET' then it is considered a data entry */
- if (strcmp(te->desc, "SEQUENCE SET") == 0) {
- res = res & REQ_DATA;
- } else {
+ /*
+ * Check if we had a dataDumper. Indicates if the entry is schema or
+ * data
+ */
+ if (!te->hadDumper)
+ {
+ /*
+ * Special Case: If 'SEQUENCE SET' then it is considered a data
+ * entry
+ */
+ if (strcmp(te->desc, "SEQUENCE SET") == 0)
+ res = res & REQ_DATA;
+ else
res = res & ~REQ_DATA;
- }
}
/* Mask it if we only want schema */
diff --git a/src/bin/pg_dump/pg_backup_archiver.h b/src/bin/pg_dump/pg_backup_archiver.h
index 15b670ee28..cb7671ca69 100644
--- a/src/bin/pg_dump/pg_backup_archiver.h
+++ b/src/bin/pg_dump/pg_backup_archiver.h
@@ -17,7 +17,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.40 2001/11/04 04:05:36 pjw Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.h,v 1.41 2001/11/05 17:46:30 momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
* - Initial version.
@@ -68,7 +68,7 @@ typedef z_stream *z_streamp;
#define K_VERS_MAJOR 1
#define K_VERS_MINOR 5
-#define K_VERS_REV 7
+#define K_VERS_REV 7
/* Data block types */
#define BLK_DATA 1
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 19728a1461..3a59d5edf1 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -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.75 2001/10/28 06:25:58 momjian Exp $
+ * $Id: pg_dump.h,v 1.76 2001/11/05 17:46:30 momjian Exp $
*
* Modifications - 6/12/96 - dave@bensoft.com - version 1.13.dhb.2
*
@@ -280,4 +280,4 @@ extern void dumpIndexes(Archive *fout, IndInfo *indinfo, int numIndexes,
extern const char *fmtId(const char *identifier, bool force_quotes);
extern void exit_nicely(void);
-#endif /* PG_DUMP_H */
+#endif /* PG_DUMP_H */
diff --git a/src/bin/pg_dump/pg_restore.c b/src/bin/pg_dump/pg_restore.c
index 633d791614..aa8c84d289 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.28 2001/11/04 04:05:36 pjw Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_restore.c,v 1.29 2001/11/05 17:46:30 momjian Exp $
*
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
*
@@ -133,7 +133,7 @@ main(int argc, char **argv)
{"use-set-session-authorization", no_argument, &use_setsessauth, 1},
{NULL, 0, NULL, 0}
};
-#endif /* HAVE_GETOPT_LONG */
+#endif /* HAVE_GETOPT_LONG */
#ifdef ENABLE_NLS