File tree Expand file tree Collapse file tree 3 files changed +40
-27
lines changed Expand file tree Collapse file tree 3 files changed +40
-27
lines changed Original file line number Diff line number Diff line change @@ -49,39 +49,39 @@ var (
4949	)
5050
5151	pgLocksQuery  =  ` 
52- 		SELECT   
52+ 		SELECT 
5353		  pg_database.datname as datname, 
5454		  tmp.mode as mode, 
55- 		  COALESCE(count, 0) as count   
56- 		FROM   
55+ 		  COALESCE(count, 0) as count 
56+ 		FROM 
5757		  ( 
58- 		    VALUES   
59- 		      ('accesssharelock'),   
60- 		      ('rowsharelock'),   
61- 		      ('rowexclusivelock'),   
62- 		      ('shareupdateexclusivelock'),   
63- 		      ('sharelock'),   
64- 		      ('sharerowexclusivelock'),   
65- 		      ('exclusivelock'),   
66- 		      ('accessexclusivelock'),   
58+ 		    VALUES 
59+ 		      ('accesssharelock'), 
60+ 		      ('rowsharelock'), 
61+ 		      ('rowexclusivelock'), 
62+ 		      ('shareupdateexclusivelock'), 
63+ 		      ('sharelock'), 
64+ 		      ('sharerowexclusivelock'), 
65+ 		      ('exclusivelock'), 
66+ 		      ('accessexclusivelock'), 
6767		      ('sireadlock') 
6868		  ) AS tmp(mode) 
69- 		  CROSS JOIN pg_database   
69+ 		  CROSS JOIN pg_database 
7070		  LEFT JOIN ( 
71- 		    SELECT   
72- 		      database,   
73- 		      lower(mode) AS mode,   
74- 		      count(*) AS count   
75- 		    FROM   
76- 		      pg_locks   
77- 		    WHERE   
78- 		      database IS NOT NULL   
79- 		    GROUP BY   
80- 		      database,   
71+ 		    SELECT 
72+ 		      database, 
73+ 		      lower(mode) AS mode, 
74+ 		      count(*) AS count 
75+ 		    FROM 
76+ 		      pg_locks 
77+ 		    WHERE 
78+ 		      database IS NOT NULL 
79+ 		    GROUP BY 
80+ 		      database, 
8181		      lower(mode) 
82- 		  ) AS tmp2 ON tmp.mode = tmp2.mode   
83- 		  and pg_database.oid = tmp2.database   
84- 		ORDER BY   
82+ 		  ) AS tmp2 ON tmp.mode = tmp2.mode 
83+ 		  and pg_database.oid = tmp2.database 
84+ 		ORDER BY 
8585		  1 
8686	` 
8787)
Original file line number Diff line number Diff line change 1+ // Copyright 2025 The Prometheus Authors 
2+ // Licensed under the Apache License, Version 2.0 (the "License"); 
3+ // you may not use this file except in compliance with the License. 
4+ // You may obtain a copy of the License at 
5+ // 
6+ // http://www.apache.org/licenses/LICENSE-2.0 
7+ // 
8+ // Unless required by applicable law or agreed to in writing, software 
9+ // distributed under the License is distributed on an "AS IS" BASIS, 
10+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
11+ // See the License for the specific language governing permissions and 
12+ // limitations under the License. 
13+ 
114package  collector
215
316import  (
Original file line number Diff line number Diff line change 1- // Copyright 2023  The Prometheus Authors 
1+ // Copyright 2025  The Prometheus Authors 
22// Licensed under the Apache License, Version 2.0 (the "License"); 
33// you may not use this file except in compliance with the License. 
44// You may obtain a copy of the License at 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments