1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

New pgindent run with fixes suggested by Tom. Patch manually reviewed,

initdb/regression tests pass.
This commit is contained in:
Bruce Momjian
2001-11-05 17:46:40 +00:00
parent 34153b2052
commit ea08e6cd55
503 changed files with 1648 additions and 1610 deletions

View File

@@ -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 */