pgrowlocks: change lock mode output labels for consistency
authorBruce Momjian
Tue, 26 Sep 2023 21:41:48 +0000 (17:41 -0400)
committerBruce Momjian
Tue, 26 Sep 2023 21:41:48 +0000 (17:41 -0400)
Change "Share" to "For Share" and "Key Share" to "For Key Share" for
consistency with other lock mode labels.

BACKWARD COMPATIBILITY BREAK

Reported-by: David Cook
Discussion:  https://postgr.es/m/CA+dNBPNBf+FCEwohe7SH1tSks0R_G4F=tuvM=hnPs4qWiAH8vg@mail.gmail.com

Backpatch-through: master

contrib/pgrowlocks/expected/pgrowlocks.out
contrib/pgrowlocks/pgrowlocks.c
doc/src/sgml/pgrowlocks.sgml

index 725467266a42affb026f272eb64fd35fc0c50271..77431bfe1897eb550876feabd4f56a25c3600f9f 100644 (file)
@@ -136,10 +136,10 @@ a|b
 (2 rows)
 
 step s2_rowlocks: SELECT locked_row, multi, modes FROM pgrowlocks('multixact_conflict');
-locked_row|multi|modes              
-----------+-----+-------------------
-(0,1)     |t    |{"Key Share",Share}
-(0,2)     |t    |{"Key Share",Share}
+locked_row|multi|modes                        
+----------+-----+-----------------------------
+(0,1)     |t    |{"For Key Share","For Share"}
+(0,2)     |t    |{"For Key Share","For Share"}
 (2 rows)
 
 step s1_commit: COMMIT;
@@ -161,10 +161,10 @@ a|b
 (2 rows)
 
 step s2_rowlocks: SELECT locked_row, multi, modes FROM pgrowlocks('multixact_conflict');
-locked_row|multi|modes                            
-----------+-----+---------------------------------
-(0,1)     |t    |{"Key Share","For No Key Update"}
-(0,2)     |t    |{"Key Share","For No Key Update"}
+locked_row|multi|modes                                
+----------+-----+-------------------------------------
+(0,1)     |t    |{"For Key Share","For No Key Update"}
+(0,2)     |t    |{"For Key Share","For No Key Update"}
 (2 rows)
 
 step s1_commit: COMMIT;
@@ -186,10 +186,10 @@ a|b
 (2 rows)
 
 step s2_rowlocks: SELECT locked_row, multi, modes FROM pgrowlocks('multixact_conflict');
-locked_row|multi|modes                     
-----------+-----+--------------------------
-(0,1)     |t    |{"Key Share","For Update"}
-(0,2)     |t    |{"Key Share","For Update"}
+locked_row|multi|modes                         
+----------+-----+------------------------------
+(0,1)     |t    |{"For Key Share","For Update"}
+(0,2)     |t    |{"For Key Share","For Update"}
 (2 rows)
 
 step s1_commit: COMMIT;
@@ -205,10 +205,10 @@ a|b
 
 step s1_updatea: UPDATE multixact_conflict SET a = 10 WHERE a = 1;
 step s2_rowlocks: SELECT locked_row, multi, modes FROM pgrowlocks('multixact_conflict');
-locked_row|multi|modes               
-----------+-----+--------------------
-(0,1)     |t    |{"Key Share",Update}
-(0,2)     |f    |{"For Key Share"}   
+locked_row|multi|modes                   
+----------+-----+------------------------
+(0,1)     |t    |{"For Key Share",Update}
+(0,2)     |f    |{"For Key Share"}       
 (2 rows)
 
 step s1_commit: COMMIT;
@@ -224,10 +224,10 @@ a|b
 
 step s1_updateb: UPDATE multixact_conflict SET b = 11 WHERE b = 4;
 step s2_rowlocks: SELECT locked_row, multi, modes FROM pgrowlocks('multixact_conflict');
-locked_row|multi|modes                        
-----------+-----+-----------------------------
-(0,1)     |f    |{"For Key Share"}            
-(0,2)     |t    |{"Key Share","No Key Update"}
+locked_row|multi|modes                            
+----------+-----+---------------------------------
+(0,1)     |f    |{"For Key Share"}                
+(0,2)     |t    |{"For Key Share","No Key Update"}
 (2 rows)
 
 step s1_commit: COMMIT;
index c543277b7c550b772803f51721796be965884889..a04e187ec4359097b019477a079ab41ea5f9aa43 100644 (file)
@@ -200,10 +200,10 @@ pgrowlocks(PG_FUNCTION_ARGS)
                                snprintf(buf, NCHARS, "For No Key Update");
                                break;
                            case MultiXactStatusForShare:
-                               snprintf(buf, NCHARS, "Share");
+                               snprintf(buf, NCHARS, "For Share");
                                break;
                            case MultiXactStatusForKeyShare:
-                               snprintf(buf, NCHARS, "Key Share");
+                               snprintf(buf, NCHARS, "For Key Share");
                                break;
                        }
                        strcat(values[Atnum_modes], buf);
index b5e655735a1d5d478c6329c68bbef7bbfae488e7..9c6e86b27ed5c33175e61143182df64008a5568d 100644 (file)
@@ -74,7 +74,7 @@ pgrowlocks(text) returns setof record
       modes
       text[]
       Lock mode of lockers (more than one if multitransaction),
-       an array of Key ShareShare,
+       an array of For Key ShareFor Share,
        For No Key UpdateNo Key Update,
        For UpdateUpdate.