Pre-beta2 mechanical code beautification.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Jun 2023 13:50:43 +0000 (09:50 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Jun 2023 13:50:43 +0000 (09:50 -0400)
Run pgindent and pgperltidy.  It seems we're still some ways
away from all committers doing this automatically.  Now that
we have a buildfarm animal that will whine about poorly-indented
code, we'll try to keep the tree more tidy.

Discussion: https://postgr.es/m/3156045.1687208823@sss.pgh.pa.us

src/backend/executor/execUtils.c
src/backend/libpq/hba.c
src/backend/replication/logical/tablesync.c
src/backend/storage/file/fd.c
src/backend/storage/ipc/standby.c
src/backend/storage/smgr/md.c
src/backend/utils/adt/pgstatfuncs.c
src/bin/initdb/t/001_initdb.pl
src/bin/scripts/t/020_createdb.pl
src/include/utils/backend_status.h
src/test/subscription/t/033_run_as_table_owner.pl

index 4758ab4132148126ee886599ce7cdbe8bf133973..c06b22885833503e489ec4f09290066931d4bc71 100644 (file)
@@ -1354,8 +1354,8 @@ ExecGetExtraUpdatedCols(ResultRelInfo *relinfo, EState *estate)
 Bitmapset *
 ExecGetAllUpdatedCols(ResultRelInfo *relinfo, EState *estate)
 {
-       Bitmapset          *ret;
-       MemoryContext   oldcxt;
+       Bitmapset  *ret;
+       MemoryContext oldcxt;
 
        oldcxt = MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
 
index 1ef113649fb7e97cd20bb0a82cbab131f5945eaf..f89f138f3c01e56c4c9e4870cddfa13fc118f3f5 100644 (file)
@@ -2693,9 +2693,8 @@ load_hba(void)
        if (!ok)
        {
                /*
-                * File contained one or more errors, so bail out.
-                * MemoryContextDelete is enough to clean up everything, including
-                * regexes.
+                * File contained one or more errors, so bail out. MemoryContextDelete
+                * is enough to clean up everything, including regexes.
                 */
                MemoryContextDelete(hbacxt);
                return false;
@@ -3057,9 +3056,8 @@ load_ident(void)
        if (!ok)
        {
                /*
-                * File contained one or more errors, so bail out.
-                * MemoryContextDelete is enough to clean up everything, including
-                * regexes.
+                * File contained one or more errors, so bail out. MemoryContextDelete
+                * is enough to clean up everything, including regexes.
                 */
                MemoryContextDelete(ident_context);
                return false;
index db10a446b3d5ad4622e37f4aacdfcc7faa76a459..6d461654ab46d7b306fb5509175ba3dfed0ebddf 100644 (file)
@@ -1253,7 +1253,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
        WalRcvExecResult *res;
        char            originname[NAMEDATALEN];
        RepOriginId originid;
-       UserContext     ucxt;
+       UserContext ucxt;
        bool            must_use_password;
        bool            run_as_owner;
 
@@ -1437,8 +1437,8 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
        }
 
        /*
-        * Make sure that the copy command runs as the table owner, unless
-        * the user has opted out of that behaviour.
+        * Make sure that the copy command runs as the table owner, unless the
+        * user has opted out of that behaviour.
         */
        run_as_owner = MySubscription->runasowner;
        if (!run_as_owner)
@@ -1482,7 +1482,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
                                                res->err)));
        walrcv_clear_result(res);
 
-       if(!run_as_owner)
+       if (!run_as_owner)
                RestoreUserContext(&ucxt);
 
        table_close(rel, NoLock);
index db39186f058ee7664de900169c8145521a817f48..3c2a2fbef73183f609b23421846545e2c07fa796 100644 (file)
@@ -415,7 +415,7 @@ pg_fsync(int fd)
 int
 pg_fsync_no_writethrough(int fd)
 {
-       int             rc;
+       int                     rc;
 
        if (!enableFsync)
                return 0;
@@ -456,7 +456,7 @@ pg_fsync_writethrough(int fd)
 int
 pg_fdatasync(int fd)
 {
-       int             rc;
+       int                     rc;
 
        if (!enableFsync)
                return 0;
@@ -500,6 +500,7 @@ pg_flush_data(int fd, off_t offset, off_t nbytes)
                        return;
 
 retry:
+
                /*
                 * sync_file_range(SYNC_FILE_RANGE_WRITE), currently linux specific,
                 * tells the OS that writeback for the specified blocks should be
index 70b0da50fc107ad124f23f09769d5d560cf38217..4c06741a69fd9ce4037af6fdb3efc3cc9d098f54 100644 (file)
@@ -1197,9 +1197,9 @@ standby_redo(XLogReaderState *record)
                /*
                 * The startup process currently has no convenient way to schedule
                 * stats to be reported. XLOG_RUNNING_XACTS records issued at a
-                * regular cadence, making this a convenient location to report
-                * stats. While these records aren't generated with wal_level=minimal,
-                * stats also cannot be accessed during WAL replay.
+                * regular cadence, making this a convenient location to report stats.
+                * While these records aren't generated with wal_level=minimal, stats
+                * also cannot be accessed during WAL replay.
                 */
                pgstat_report_stat(true);
        }
index 7353ed31d899266b6697688c8fbd0825084f84bb..30dbc02f823ac44ed93b68765ef9cc830475f722 100644 (file)
@@ -564,10 +564,10 @@ mdzeroextend(SMgrRelation reln, ForkNumber forknum,
                Assert(segstartblock + numblocks <= RELSEG_SIZE);
 
                /*
-                * If available and useful, use posix_fallocate() (via FileFallocate())
-                * to extend the relation. That's often more efficient than using
-                * write(), as it commonly won't cause the kernel to allocate page
-                * cache space for the extended pages.
+                * If available and useful, use posix_fallocate() (via
+                * FileFallocate()) to extend the relation. That's often more
+                * efficient than using write(), as it commonly won't cause the kernel
+                * to allocate page cache space for the extended pages.
                 *
                 * However, we don't use FileFallocate() for small extensions, as it
                 * defeats delayed allocation on some filesystems. Not clear where
index 49adc319fc80e6bf2593b3d21ae386b40ab48063..2a4c8ef87ff4e5a5d85ca83852ef2c01ff35eed2 100644 (file)
@@ -601,7 +601,7 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
                                values[26] = CStringGetTextDatum(beentry->st_gssstatus->gss_princ);
                                values[27] = BoolGetDatum(beentry->st_gssstatus->gss_enc);      /* GSS Encryption in use */
                                values[28] = BoolGetDatum(beentry->st_gssstatus->gss_delegation);       /* GSS credentials
-                                                                                                                                                                * delegated */
+                                                                                                                                                                        * delegated */
                        }
                        else
                        {
index cf55a84cd1881caa6109191409e75003357d96b6..8b4acb7148eba525dffdc1eeb1e8e8d4ca220a83 100644 (file)
@@ -113,10 +113,12 @@ if ($ENV{with_icu} eq 'yes')
 
        command_like(
                [
-                       'initdb', '--no-sync', '-A', 'trust',
+                       'initdb', '--no-sync',
+                       '-A', 'trust',
                        '--locale-provider=icu', '--locale=und',
-                       '--lc-collate=C', '--lc-ctype=C', '--lc-messages=C',
-                       '--lc-numeric=C', '--lc-monetary=C', '--lc-time=C',
+                       '--lc-collate=C', '--lc-ctype=C',
+                       '--lc-messages=C', '--lc-numeric=C',
+                       '--lc-monetary=C', '--lc-time=C',
                        "$tempdir/data4"
                ],
                qr/^\s+ICU locale:\s+und\n/ms,
index 694ec5680472fd1dcb533b5aab30df543c9e3667..57383561a0cd7baaf8247a3c2d8ec77374bb1974 100644 (file)
@@ -89,12 +89,14 @@ if ($ENV{with_icu} eq 'yes')
 
        $node2->command_ok(
                [
-                       'createdb', '-T', 'template0', '--locale-provider', 'icu',
-                       '--locale', 'en', '--lc-collate', 'C', '--lc-ctype', 'C',
-                       'foobar57'
+                       'createdb', '-T',
+                       'template0', '--locale-provider',
+                       'icu', '--locale',
+                       'en', '--lc-collate',
+                       'C', '--lc-ctype',
+                       'C', 'foobar57'
                ],
-               'create database with locale as ICU locale'
-       );
+               'create database with locale as ICU locale');
 }
 else
 {
index 16500d53b2a6f27f606326a71ec10923649707c1..77939a0aedea3b946ba5cad99528e8b8b06a71bf 100644 (file)
@@ -77,7 +77,7 @@ typedef struct PgBackendGSSStatus
        char            gss_princ[NAMEDATALEN]; /* GSSAPI Principal used to auth */
        bool            gss_auth;               /* If GSSAPI authentication was used */
        bool            gss_enc;                /* If encryption is being used */
-       bool            gss_delegation; /* If credentials delegated */
+       bool            gss_delegation; /* If credentials delegated */
 
 } PgBackendGSSStatus;
 
index 2d0e0e78e3ef5e11a849b173e542567d256430f6..9de3c04a0c214f8b8f0cee13ccef7c4ae22d5ea3 100644 (file)
@@ -196,7 +196,7 @@ expect_replication("alice.unpartitioned", 3, 7, 13,
 # Remove the subscrition and truncate the table for the initial data sync
 # tests.
 $node_subscriber->safe_psql(
-           'postgres', qq(
+       'postgres', qq(
 DROP SUBSCRIPTION admin_sub;
 TRUNCATE alice.unpartitioned;
 ));
@@ -204,7 +204,7 @@ TRUNCATE alice.unpartitioned;
 # Create a new subscription "admin_sub" owned by regress_admin2. It's
 # disabled so that we revoke superuser privilege after creation.
 $node_subscriber->safe_psql(
-    'postgres', qq(
+       'postgres', qq(
 SET SESSION AUTHORIZATION regress_admin2;
 CREATE SUBSCRIPTION admin_sub CONNECTION '$publisher_connstr' PUBLICATION alice
 WITH (run_as_owner = false, password_required = false, copy_data = true, enabled = false);
@@ -214,16 +214,15 @@ WITH (run_as_owner = false, password_required = false, copy_data = true, enabled
 # ability to SET ROLE. Then enable the subscription "admin_sub".
 revoke_superuser("regress_admin2");
 $node_subscriber->safe_psql(
-    'postgres', qq(
+       'postgres', qq(
 GRANT regress_alice TO regress_admin2 WITH INHERIT FALSE, SET TRUE;
 ALTER SUBSCRIPTION admin_sub ENABLE;
 ));
 
 # Because the initial data sync is working as the table owner, all
 # data should be copied.
-$node_subscriber->wait_for_subscription_sync($node_publisher,
-                                            'admin_sub');
+$node_subscriber->wait_for_subscription_sync($node_publisher, 'admin_sub');
 expect_replication("alice.unpartitioned", 3, 7, 13,
-                  "table owner can do the initial data copy");
+       "table owner can do the initial data copy");
 
 done_testing();