File Coverage

blib/lib/Pgtools.pm
Criterion Covered Total %
statement 8 8 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 11 11 100.0


line stmt bran cond sub pod time code
1             package Pgtools;
2 3     3   560 use 5.021001;
  3         8  
3 3     3   10 use strict;
  3         3  
  3         44  
4 3     3   16 use warnings;
  3         3  
  3         110  
5              
6             our $VERSION = "0.008";
7              
8             1;
9             __END__
10              
11             =encoding utf-8
12              
13             =head1 NAME
14              
15             Pgtools - It's a yet another command-line tool for PostgreSQL operation.
16              
17             =head1 SYNOPSIS
18              
19             =head2 pg_kill
20             $ pg_kill -kill -print -mq "like\s'\%.*\%'" "192.168.32.12,5432,postgres,,dvdrental"
21             -------------------------------
22             Killed-pid: 11590
23             At : 2016/03/21 01:32:29
24             Query : SELECT * FROM actor WHERE last_name like '%a%';
25             Killed matched queries!
26              
27              
28             =head2 pg_config_diff
29             $ pg_config_diff "192.168.33.21,5432,postgres,," "192.168.33.22,,,," "192.168.33.23,5432,postgres,,dvdrental"
30             <Setting Name> 192.168.33.21 192.168.33.22 192.168.33.23
31             --------------------------------------------------------------------------------------------
32             max_connections 50 100 100
33             shared_buffers 32768 16384 65536
34             tcp_keepalives_idle 8000 7200 10000
35             tcp_keepalives_interval 75 75 10
36             wal_buffers 1024 512 2048
37              
38              
39             =head2 pg_fingerprint
40             $ pg_fingerprint queries_file
41             SELECT * FROM user WHERE id = ?;
42             SELECT * FROM user2 WHERE id = ? LIMIT ?;
43             SELECT * FROM user2 WHERE point = ?;
44             SELECT * FROM user2 WHERE expression IS ?;
45              
46              
47              
48             =head1 DESCRIPTION
49              
50             Pgtools is composed of 3 commands which is pg_kill, pg_config_diff, pg_fingerprint.
51              
52             - pg_kill shows the specified queries during execution by regular expression and other options. And also kill these specifid queries by -kill option.
53             - pg_config_diff command needs more than 2 argument which is string to specify the PostgreSQL databases.
54             - pg_fingerprint command converts the values into a placeholders.
55              
56             =head1 LICENSE
57              
58             Copyright (C) Otsuka Tomoaki.
59              
60             This library is free software; you can redistribute it and/or modify
61             it under the same terms as Perl itself.
62              
63             =head1 AUTHOR
64              
65             Otsuka Tomoaki E<lt>otsuka.t.2013@gmail.comE<gt>
66              
67             =cut
68