Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzdEQ-0006T5-4x for pgsql-hackers@arkaria.postgresql.org; Thu, 18 May 2023 12:59:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pzdEP-0001u6-2A for pgsql-hackers@arkaria.postgresql.org; Thu, 18 May 2023 12:59:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzdEO-0001pq-NH for pgsql-hackers@lists.postgresql.org; Thu, 18 May 2023 12:59:44 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pzdEG-000XCU-Lr for pgsql-hackers@postgresql.org; Thu, 18 May 2023 12:59:44 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 0159040008; Thu, 18 May 2023 12:59:29 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------DeB2J0xZUH620IJrQO3hB6UV" Message-ID: <2c4941fd-2d64-a0b7-5b92-bd3fef933974@dunslane.net> Date: Thu, 18 May 2023 08:59:28 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: run pgindent on a regular basis / scripted manner Content-Language: en-US To: Tom Lane Cc: Peter Eisentraut , Jelte Fennema , "shiy.fnst@fujitsu.com" , Robert Haas , Justin Pryzby , Andres Freund , Noah Misch , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , "pgsql-hackers@postgresql.org" References: <1d66447e-a77b-ca0d-90a0-782800e85383@dunslane.net> <3665234.1682174388@sss.pgh.pa.us> <3711455.1682193493@sss.pgh.pa.us> <3841176.1682262970@sss.pgh.pa.us> <183836.1682345671@sss.p! gh.pa.us> <841085.1682515625@sss.pgh.pa.us> <341b0011-1190-288b! ! -6773-e0bbe7495480@dunslane.net> <894796.1682539507@sss.pgh.pa.us> <3585680.1684357848@sss.pgh.pa.us> From: Andrew Dunstan In-Reply-To: <3585680.1684357848@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------DeB2J0xZUH620IJrQO3hB6UV Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-05-17 We 17:10, Tom Lane wrote: > I wrote: >> Andrew Dunstan writes: >>> I doubt there's something like that. >> I had a read-through of the latest version's man page, and found >> this promising-looking entry: >> -boc, --break-at-old-comma-breakpoints > Sadly, this seems completely not ready for prime time. I experimented > with it under perltidy 20230309, and found that it caused hundreds > of kilobytes of gratuitous changes that don't seem to have a direct > connection to the claimed purpose. Most of these seemed to be from > forcing a line break after a function call's open paren, like > > @@ -50,10 +50,12 @@ detects_heap_corruption( > # > fresh_test_table('test'); > $node->safe_psql('postgres', q(VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) test)); > -detects_no_corruption("verify_heapam('test')", > +detects_no_corruption( > + "verify_heapam('test')", > "all-frozen not corrupted table"); > corrupt_first_page('test'); > -detects_heap_corruption("verify_heapam('test')", > +detects_heap_corruption( > + "verify_heapam('test')", > "all-frozen corrupted table"); > detects_no_corruption( > "verify_heapam('test', skip := 'all-frozen')", > > although in some places it just wanted to insert a space, like this: > > @@ -77,9 +81,9 @@ print "standby 2: $result\n"; > is($result, qq(33|0|t), 'check streamed sequence content on standby 2'); > > # Check that only READ-only queries can run on standbys > -is($node_standby_1->psql('postgres', 'INSERT INTO tab_int VALUES (1)'), > +is( $node_standby_1->psql('postgres', 'INSERT INTO tab_int VALUES (1)'), > 3, 'read-only queries on standby 1'); > -is($node_standby_2->psql('postgres', 'INSERT INTO tab_int VALUES (1)'), > +is( $node_standby_2->psql('postgres', 'INSERT INTO tab_int VALUES (1)'), > 3, 'read-only queries on standby 2'); > > # Tests for connection parameter target_session_attrs > > > So I don't think we want that. Maybe in some future version it'll > be more under control. > > Barring objections, I'll use the attached on Friday. > > LGTM cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------DeB2J0xZUH620IJrQO3hB6UV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2023-05-17 We 17:10, Tom Lane wrote:
I wrote:
Andrew Dunstan <andrew@dunslane.net> writes:
I doubt there's something like that.

      
I had a read-through of the latest version's man page, and found
this promising-looking entry:
	-boc, --break-at-old-comma-breakpoints
Sadly, this seems completely not ready for prime time.  I experimented
with it under perltidy 20230309, and found that it caused hundreds
of kilobytes of gratuitous changes that don't seem to have a direct
connection to the claimed purpose.  Most of these seemed to be from
forcing a line break after a function call's open paren, like

@@ -50,10 +50,12 @@ detects_heap_corruption(
 #
 fresh_test_table('test');
 $node->safe_psql('postgres', q(VACUUM (FREEZE, DISABLE_PAGE_SKIPPING) test));
-detects_no_corruption("verify_heapam('test')",
+detects_no_corruption(
+	"verify_heapam('test')",
 	"all-frozen not corrupted table");
 corrupt_first_page('test');
-detects_heap_corruption("verify_heapam('test')",
+detects_heap_corruption(
+	"verify_heapam('test')",
 	"all-frozen corrupted table");
 detects_no_corruption(
 	"verify_heapam('test', skip := 'all-frozen')",

although in some places it just wanted to insert a space, like this:

@@ -77,9 +81,9 @@ print "standby 2: $result\n";
 is($result, qq(33|0|t), 'check streamed sequence content on standby 2');
 
 # Check that only READ-only queries can run on standbys
-is($node_standby_1->psql('postgres', 'INSERT INTO tab_int VALUES (1)'),
+is( $node_standby_1->psql('postgres', 'INSERT INTO tab_int VALUES (1)'),
 	3, 'read-only queries on standby 1');
-is($node_standby_2->psql('postgres', 'INSERT INTO tab_int VALUES (1)'),
+is( $node_standby_2->psql('postgres', 'INSERT INTO tab_int VALUES (1)'),
 	3, 'read-only queries on standby 2');
 
 # Tests for connection parameter target_session_attrs


So I don't think we want that.  Maybe in some future version it'll
be more under control.

Barring objections, I'll use the attached on Friday.

			


LGTM


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------DeB2J0xZUH620IJrQO3hB6UV--