Skip to content

Commit 7584649

Browse files
committed
Re-pgindent src/bin/pg_dump/*.
Seems to have gotten rather messy lately, as a consequence of a couple of large recent commits.
1 parent 389573f commit 7584649

File tree

7 files changed

+64
-59
lines changed

7 files changed

+64
-59
lines changed

src/bin/pg_dump/parallel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,8 @@ readMessageFromPipe(int fd)
13311331
static int
13321332
pgpipe(int handles[2])
13331333
{
1334-
pgsocket s, tmp_sock;
1334+
pgsocket s,
1335+
tmp_sock;
13351336
struct sockaddr_in serv_addr;
13361337
int len = sizeof(serv_addr);
13371338

src/bin/pg_dump/parallel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ typedef enum
3232
/* Arguments needed for a worker process */
3333
typedef struct ParallelArgs
3434
{
35-
ArchiveHandle *AH;
36-
TocEntry *te;
35+
ArchiveHandle *AH;
36+
TocEntry *te;
3737
} ParallelArgs;
3838

3939
/* State for each parallel activity slot */

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4241,7 +4241,7 @@ identify_locking_dependencies(ArchiveHandle *AH, TocEntry *te)
42414241

42424242
if (depid <= AH->maxDumpId && AH->tocsByDumpId[depid] != NULL &&
42434243
((strcmp(AH->tocsByDumpId[depid]->desc, "TABLE DATA") == 0) ||
4244-
strcmp(AH->tocsByDumpId[depid]->desc, "TABLE") == 0))
4244+
strcmp(AH->tocsByDumpId[depid]->desc, "TABLE") == 0))
42454245
lockids[nlockids++] = depid;
42464246
}
42474247

src/bin/pg_dump/pg_backup_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ EndDBCopyMode(Archive *AHX, const char *tocEntryTag)
572572
res = PQgetResult(AH->connection);
573573
if (PQresultStatus(res) != PGRES_COMMAND_OK)
574574
warn_or_exit_horribly(AH, modulename, "COPY failed for table \"%s\": %s",
575-
tocEntryTag, PQerrorMessage(AH->connection));
575+
tocEntryTag, PQerrorMessage(AH->connection));
576576
PQclear(res);
577577

578578
AH->pgCopyIn = false;

src/bin/pg_dump/pg_dump.c

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ main(int argc, char **argv)
275275
int compressLevel = -1;
276276
int plainText = 0;
277277
ArchiveFormat archiveFormat = archUnknown;
278-
ArchiveMode archiveMode;
278+
ArchiveMode archiveMode;
279279

280280
DumpOptions *dopt = NewDumpOptions();
281281

@@ -2156,7 +2156,8 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
21562156
*collate,
21572157
*ctype,
21582158
*tablespace;
2159-
uint32 frozenxid, minmxid;
2159+
uint32 frozenxid,
2160+
minmxid;
21602161

21612162
datname = PQdb(conn);
21622163

@@ -2186,7 +2187,7 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
21862187
appendPQExpBuffer(dbQry, "SELECT tableoid, oid, "
21872188
"(%s datdba) AS dba, "
21882189
"pg_encoding_to_char(encoding) AS encoding, "
2189-
"datcollate, datctype, datfrozenxid, 0 AS datminmxid, "
2190+
"datcollate, datctype, datfrozenxid, 0 AS datminmxid, "
21902191
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = dattablespace) AS tablespace, "
21912192
"shobj_description(oid, 'pg_database') AS description "
21922193

@@ -2200,7 +2201,7 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
22002201
appendPQExpBuffer(dbQry, "SELECT tableoid, oid, "
22012202
"(%s datdba) AS dba, "
22022203
"pg_encoding_to_char(encoding) AS encoding, "
2203-
"NULL AS datcollate, NULL AS datctype, datfrozenxid, 0 AS datminmxid, "
2204+
"NULL AS datcollate, NULL AS datctype, datfrozenxid, 0 AS datminmxid, "
22042205
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = dattablespace) AS tablespace, "
22052206
"shobj_description(oid, 'pg_database') AS description "
22062207

@@ -2214,7 +2215,7 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
22142215
appendPQExpBuffer(dbQry, "SELECT tableoid, oid, "
22152216
"(%s datdba) AS dba, "
22162217
"pg_encoding_to_char(encoding) AS encoding, "
2217-
"NULL AS datcollate, NULL AS datctype, datfrozenxid, 0 AS datminmxid, "
2218+
"NULL AS datcollate, NULL AS datctype, datfrozenxid, 0 AS datminmxid, "
22182219
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = dattablespace) AS tablespace "
22192220
"FROM pg_database "
22202221
"WHERE datname = ",
@@ -2338,7 +2339,8 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
23382339
PGresult *lo_res;
23392340
PQExpBuffer loFrozenQry = createPQExpBuffer();
23402341
PQExpBuffer loOutQry = createPQExpBuffer();
2341-
int i_relfrozenxid, i_relminmxid;
2342+
int i_relfrozenxid,
2343+
i_relminmxid;
23422344

23432345
/*
23442346
* pg_largeobject
@@ -2383,16 +2385,16 @@ dumpDatabase(Archive *fout, DumpOptions *dopt)
23832385
resetPQExpBuffer(loFrozenQry);
23842386
resetPQExpBuffer(loOutQry);
23852387

2386-
if (fout->remoteVersion >= 90300)
2387-
appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid, relminmxid\n"
2388-
"FROM pg_catalog.pg_class\n"
2389-
"WHERE oid = %u;\n",
2390-
LargeObjectMetadataRelationId);
2391-
else
2392-
appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid, 0 AS relminmxid\n"
2393-
"FROM pg_catalog.pg_class\n"
2394-
"WHERE oid = %u;\n",
2395-
LargeObjectMetadataRelationId);
2388+
if (fout->remoteVersion >= 90300)
2389+
appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid, relminmxid\n"
2390+
"FROM pg_catalog.pg_class\n"
2391+
"WHERE oid = %u;\n",
2392+
LargeObjectMetadataRelationId);
2393+
else
2394+
appendPQExpBuffer(loFrozenQry, "SELECT relfrozenxid, 0 AS relminmxid\n"
2395+
"FROM pg_catalog.pg_class\n"
2396+
"WHERE oid = %u;\n",
2397+
LargeObjectMetadataRelationId);
23962398

23972399
lo_res = ExecuteSqlQueryForSingleRow(fout, loFrozenQry->data);
23982400

@@ -2747,22 +2749,24 @@ dumpBlobs(Archive *fout, DumpOptions *dopt, void *arg)
27472749

27482750
/*
27492751
* getRowSecurity
2750-
* get information about every row-security policy on a dumpable table.
2752+
* get information about every row-security policy on a dumpable table.
27512753
*/
27522754
void
27532755
getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
27542756
{
2755-
PQExpBuffer query;
2756-
PGresult *res;
2757+
PQExpBuffer query;
2758+
PGresult *res;
27572759
RowSecurityInfo *rsinfo;
2758-
int i_oid;
2759-
int i_tableoid;
2760-
int i_rsecpolname;
2761-
int i_rseccmd;
2762-
int i_rsecroles;
2763-
int i_rsecqual;
2764-
int i_rsecwithcheck;
2765-
int i, j, ntups;
2760+
int i_oid;
2761+
int i_tableoid;
2762+
int i_rsecpolname;
2763+
int i_rseccmd;
2764+
int i_rsecroles;
2765+
int i_rsecqual;
2766+
int i_rsecwithcheck;
2767+
int i,
2768+
j,
2769+
ntups;
27662770

27672771
if (fout->remoteVersion < 90500)
27682772
return;
@@ -2771,7 +2775,7 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
27712775

27722776
for (i = 0; i < numTables; i++)
27732777
{
2774-
TableInfo *tbinfo = &tblinfo[i];
2778+
TableInfo *tbinfo = &tblinfo[i];
27752779

27762780
/* Ignore row-security on tables not to be dumped */
27772781
if (!tbinfo->dobj.dump)
@@ -2783,9 +2787,9 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
27832787
tbinfo->dobj.name);
27842788

27852789
/*
2786-
* Get row-security enabled information for the table.
2787-
* We represent RLS enabled on a table by creating RowSecurityInfo
2788-
* object with an empty policy.
2790+
* Get row-security enabled information for the table. We represent
2791+
* RLS enabled on a table by creating RowSecurityInfo object with an
2792+
* empty policy.
27892793
*/
27902794
if (tbinfo->rowsec)
27912795
{
@@ -2826,7 +2830,7 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
28262830
"CASE WHEN s.rsecroles = '{0}' THEN 'PUBLIC' ELSE "
28272831
" array_to_string(ARRAY(SELECT rolname from pg_roles WHERE oid = ANY(s.rsecroles)), ', ') END AS rsecroles, "
28282832
"pg_get_expr(s.rsecqual, s.rsecrelid) AS rsecqual, "
2829-
"pg_get_expr(s.rsecwithcheck, s.rsecrelid) AS rsecwithcheck "
2833+
"pg_get_expr(s.rsecwithcheck, s.rsecrelid) AS rsecwithcheck "
28302834
"FROM pg_catalog.pg_rowsecurity s "
28312835
"WHERE rsecrelid = '%u'",
28322836
tbinfo->dobj.catId.oid);
@@ -2894,7 +2898,7 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
28942898

28952899
/*
28962900
* dumpRowSecurity
2897-
* dump the definition of the given row-security policy
2901+
* dump the definition of the given row-security policy
28982902
*/
28992903
static void
29002904
dumpRowSecurity(Archive *fout, DumpOptions *dopt, RowSecurityInfo *rsinfo)
@@ -2909,8 +2913,8 @@ dumpRowSecurity(Archive *fout, DumpOptions *dopt, RowSecurityInfo *rsinfo)
29092913

29102914
/*
29112915
* If rsecpolname is NULL, then this record is just indicating that ROW
2912-
* LEVEL SECURITY is enabled for the table.
2913-
* Dump as ALTER TABLE <table> ENABLE ROW LEVEL SECURITY.
2916+
* LEVEL SECURITY is enabled for the table. Dump as ALTER TABLE <table>
2917+
* ENABLE ROW LEVEL SECURITY.
29142918
*/
29152919
if (rsinfo->rsecpolname == NULL)
29162920
{
@@ -6622,8 +6626,8 @@ getTableAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTable
66226626
*/
66236627
if (g_verbose)
66246628
write_msg(NULL, "finding the columns and types of table \"%s\".\"%s\"\n",
6625-
tbinfo->dobj.namespace->dobj.name,
6626-
tbinfo->dobj.name);
6629+
tbinfo->dobj.namespace->dobj.name,
6630+
tbinfo->dobj.name);
66276631

66286632
resetPQExpBuffer(q);
66296633

@@ -6835,8 +6839,8 @@ getTableAttrs(Archive *fout, DumpOptions *dopt, TableInfo *tblinfo, int numTable
68356839

68366840
if (g_verbose)
68376841
write_msg(NULL, "finding default expressions of table \"%s\".\"%s\"\n",
6838-
tbinfo->dobj.namespace->dobj.name,
6839-
tbinfo->dobj.name);
6842+
tbinfo->dobj.namespace->dobj.name,
6843+
tbinfo->dobj.name);
68406844

68416845
resetPQExpBuffer(q);
68426846
if (fout->remoteVersion >= 70300)
@@ -13772,7 +13776,7 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo)
1377213776
* Analogously, we set up typed tables using ALTER TABLE / OF here.
1377313777
*/
1377413778
if (dopt->binary_upgrade && (tbinfo->relkind == RELKIND_RELATION ||
13775-
tbinfo->relkind == RELKIND_FOREIGN_TABLE))
13779+
tbinfo->relkind == RELKIND_FOREIGN_TABLE))
1377613780
{
1377713781
for (j = 0; j < tbinfo->numatts; j++)
1377813782
{
@@ -13874,7 +13878,7 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo)
1387413878
/* We preserve the toast oids, so we can use it during restore */
1387513879
appendPQExpBufferStr(q, "\n-- For binary upgrade, set toast's relfrozenxid and relminmxid\n");
1387613880
appendPQExpBuffer(q, "UPDATE pg_catalog.pg_class\n"
13877-
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
13881+
"SET relfrozenxid = '%u', relminmxid = '%u'\n"
1387813882
"WHERE oid = '%u';\n",
1387913883
tbinfo->toast_frozenxid,
1388013884
tbinfo->toast_minmxid, tbinfo->toast_oid);

src/bin/pg_dump/pg_dump.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@ typedef struct _blobInfo
460460
*/
461461
typedef struct _rowSecurityInfo
462462
{
463-
DumpableObject dobj;
464-
TableInfo *rstable;
465-
char *rsecpolname; /* null indicates RLS is enabled on rel */
466-
char *rseccmd;
467-
char *rsecroles;
468-
char *rsecqual;
469-
char *rsecwithcheck;
463+
DumpableObject dobj;
464+
TableInfo *rstable;
465+
char *rsecpolname; /* null indicates RLS is enabled on rel */
466+
char *rseccmd;
467+
char *rsecroles;
468+
char *rsecqual;
469+
char *rsecwithcheck;
470470
} RowSecurityInfo;
471471

472472
/* global decls */

src/bin/pg_dump/pg_dumpall.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void buildShSecLabels(PGconn *conn, const char *catalog_name,
5757
uint32 objectId, PQExpBuffer buffer,
5858
const char *target, const char *objname);
5959
static PGconn *connectDatabase(const char *dbname, const char *connstr, const char *pghost, const char *pgport,
60-
const char *pguser, trivalue prompt_password, bool fail_on_error);
60+
const char *pguser, trivalue prompt_password, bool fail_on_error);
6161
static char *constructConnStr(const char **keywords, const char **values);
6262
static PGresult *executeQuery(PGconn *conn, const char *query);
6363
static void executeCommand(PGconn *conn, const char *query);
@@ -1277,7 +1277,7 @@ dumpCreateDB(PGconn *conn)
12771277
"SELECT datname, "
12781278
"coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
12791279
"pg_encoding_to_char(d.encoding), "
1280-
"datcollate, datctype, datfrozenxid, 0 AS datminmxid, "
1280+
"datcollate, datctype, datfrozenxid, 0 AS datminmxid, "
12811281
"datistemplate, datacl, datconnlimit, "
12821282
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
12831283
"FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
@@ -1287,7 +1287,7 @@ dumpCreateDB(PGconn *conn)
12871287
"SELECT datname, "
12881288
"coalesce(rolname, (select rolname from pg_authid where oid=(select datdba from pg_database where datname='template0'))), "
12891289
"pg_encoding_to_char(d.encoding), "
1290-
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
1290+
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
12911291
"datistemplate, datacl, datconnlimit, "
12921292
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
12931293
"FROM pg_database d LEFT JOIN pg_authid u ON (datdba = u.oid) "
@@ -1297,7 +1297,7 @@ dumpCreateDB(PGconn *conn)
12971297
"SELECT datname, "
12981298
"coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), "
12991299
"pg_encoding_to_char(d.encoding), "
1300-
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
1300+
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
13011301
"datistemplate, datacl, -1 as datconnlimit, "
13021302
"(SELECT spcname FROM pg_tablespace t WHERE t.oid = d.dattablespace) AS dattablespace "
13031303
"FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) "
@@ -1307,7 +1307,7 @@ dumpCreateDB(PGconn *conn)
13071307
"SELECT datname, "
13081308
"coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), "
13091309
"pg_encoding_to_char(d.encoding), "
1310-
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
1310+
"null::text AS datcollate, null::text AS datctype, datfrozenxid, 0 AS datminmxid, "
13111311
"datistemplate, datacl, -1 as datconnlimit, "
13121312
"'pg_default' AS dattablespace "
13131313
"FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) "
@@ -1419,7 +1419,7 @@ dumpCreateDB(PGconn *conn)
14191419
{
14201420
appendPQExpBufferStr(buf, "-- For binary upgrade, set datfrozenxid and datminmxid.\n");
14211421
appendPQExpBuffer(buf, "UPDATE pg_catalog.pg_database "
1422-
"SET datfrozenxid = '%u', datminmxid = '%u' "
1422+
"SET datfrozenxid = '%u', datminmxid = '%u' "
14231423
"WHERE datname = ",
14241424
dbfrozenxid, dbminmxid);
14251425
appendStringLiteralConn(buf, dbname, conn);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy