2017-01-10 12:58 GMT-05:00 Edmundo Robles <edmundo@xxxxxxxxxxxx>:
whe i do a ps -fea | grep postgres this is the outputostgres 11436 2467 0 11:41 ? 00:00:01 postgres: argos_admin vacia 127.0.0.1(54880) idlepostgres 19648 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(60858) idlepostgres 19649 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(60859) idlepostgres 19653 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(60863) idlepostgres 19656 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(60866) idlepostgres 19657 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(60867) idlepostgres 20253 2467 0 11:46 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(32961) idlepostgres 21280 2467 0 11:47 ? 00:00:00 postgres: argos_admin vacia ::1(33804) idlepostgres 21692 2467 0 11:48 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(33840) idlepostgres 21817 2467 0 11:48 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(33948) idlepostgres 21819 2467 0 11:48 ? 00:00:01 postgres: argos_admin vacia 127.0.0.1(33949) idlepostgres 21823 2467 0 11:48 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(33953) idlepostgres 21825 2467 0 11:48 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(33955) idlepostgres 21844 2467 0 11:48 ? 00:00:01 postgres: argos_admin vacia 127.0.0.1(33974) idlepostgres 22576 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia ::1(34604) idlepostgres 22713 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia ::1(34673) idlepostgres 22811 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia ::1(34718) SELECT waitingpostgres 22825 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34512) idlepostgres 22828 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34515) idlepostgres 22903 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34578) idlepostgres 22925 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34600) idlepostgres 22926 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34601) idlepostgres 22928 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34604) idlepostgres 22929 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34605) idlepostgres 22939 2467 0 11:49 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34614) idlepostgres 23510 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34953) idlepostgres 23511 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34954) idlepostgres 23512 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34955) idlepostgres 23516 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34957) idlepostgres 23520 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34959) idlepostgres 23549 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(34980) SELECT waitingpostgres 23584 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35002) idlepostgres 23612 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35006) idlepostgres 23623 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35227) idlepostgres 23638 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35231) idlepostgres 23644 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35017) idlepostgres 23658 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35025) idlepostgres 23663 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35244) SELECT waitingpostgres 23674 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35249) idlepostgres 23685 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35254) idlepostgres 23726 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35056) idlepostgres 23731 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35275) idlepostgres 23734 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35060) SELECT waitingpostgres 23736 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia ::1(35280) idlepostgres 23747 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35067) idlepostgres 23756 2467 0 11:50 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35071) SELECT waitingpostgres 23773 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia ::1(35296) SELECT waitingpostgres 23788 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35086) idlepostgres 23794 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35090) SELECT waitingpostgres 24298 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia ::1(35567) SELECT waitingpostgres 24300 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35351) SELECT waitingpostgres 24376 2467 0 11:51 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(35407) idlepostgres 25341 2467 0 11:53 ? 00:00:00 postgres: argos_admin vacia ::1(36129) SELECT waitingpostgres 27028 2467 0 11:54 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37151) SELECT waitingpostgres 27032 2467 0 11:54 ? 00:00:00 postgres: argos_admin vacia ::1(37370) idlepostgres 27038 2467 0 11:54 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37156) SELECT waitingpostgres 27042 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37375) idlepostgres 27047 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37161) SELECT waitingpostgres 27052 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37381) idlepostgres 27057 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37167) idlepostgres 27064 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37386) SELECT waitingpostgres 27069 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37172) idlepostgres 27076 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37392) SELECT waitingpostgres 27081 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37178) idlepostgres 27086 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37397) idlepostgres 27093 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37184) idlepostgres 27096 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37403) idlepostgres 27103 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37188) SELECT waitingpostgres 27108 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37407) idlepostgres 27113 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37192) SELECT waitingpostgres 27118 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37411) idlepostgres 27120 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37196) idlepostgres 27125 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37417) idlepostgres 27134 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37202) idlepostgres 27136 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37421) idlepostgres 27140 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37206) SELECT waitingpostgres 27212 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37429) idlepostgres 27215 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37214) idlepostgres 27221 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37434) SELECT waitingpostgres 27227 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37220) idlepostgres 27230 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37439) idlepostgres 27237 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37224) idlepostgres 27242 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37443) idlepostgres 27251 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37232) SELECT waitingpostgres 27258 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37453) idlepostgres 27263 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37238) SELECT waitingpostgres 27265 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37457) SELECT waitingpostgres 27276 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37246) idlepostgres 27280 2467 0 11:55 ? 00:00:00 postgres: argos_admin vacia ::1(37465) idlepostgres 27995 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(37718) idlepostgres 28001 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia ::1(37939) SELECT waitingpostgres 28697 2467 22 11:56 ? 00:00:03 postgres: argos_admin vacia 127.0.0.1(38326) SELECTpostgres 28850 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38472) PARSE waitingpostgres 28856 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38476) PARSE waitingpostgres 28859 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38479) SELECT waitingpostgres 28860 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38480) PARSE waitingpostgres 28862 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38482) PARSE waitingpostgres 28863 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38483) PARSE waitingpostgres 28864 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38484) PARSE waitingpostgres 28865 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38485) PARSE waitingpostgres 28866 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38486) PARSE waitingpostgres 28867 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38487) PARSE waitingpostgres 28868 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38488) PARSE waitingpostgres 28869 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38489) PARSE waitingpostgres 28870 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38490) PARSE waitingpostgres 28873 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38493) PARSE waitingpostgres 28874 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38494) PARSE waitingpostgres 28876 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38496) PARSE waitingpostgres 28877 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38497) PARSE waitingpostgres 28880 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38500) PARSE waitingpostgres 28881 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38501) SELECT waitingpostgres 28882 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38502) PARSE waitingpostgres 28884 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38503) PARSE waitingpostgres 28885 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38504) PARSE waitingpostgres 28887 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38505) PARSE waitingpostgres 28888 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38506) PARSE waitingpostgres 28889 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38507) PARSE waitingpostgres 28890 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38508) PARSE waitingpostgres 28891 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38509) PARSE waitingpostgres 28892 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38510) PARSE waitingpostgres 28893 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38511) PARSE waitingpostgres 28894 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38512) PARSE waitingpostgres 28896 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38514) PARSE waitingpostgres 28899 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38517) PARSE waitingpostgres 28900 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38519) PARSE waitingpostgres 28903 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38520) PARSE waitingpostgres 28904 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38521) PARSE waitingpostgres 28905 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38522) PARSE waitingpostgres 28910 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38525) PARSE waitingpostgres 28912 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38527) PARSE waitingpostgres 28918 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38532) PARSE waitingpostgres 28920 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38533) PARSE waitingpostgres 28921 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38534) PARSE waitingpostgres 28922 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38535) PARSE waitingpostgres 28924 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38537) PARSE waitingpostgres 28927 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38540) PARSE waitingpostgres 28928 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38541) PARSE waitingpostgres 28929 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38542) PARSE waitingpostgres 28930 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38543) PARSE waitingpostgres 28931 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38544) PARSE waitingpostgres 28932 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38545) PARSE waitingpostgres 28933 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38546) PARSE waitingpostgres 28934 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38547) PARSE waitingpostgres 28935 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38548) PARSE waitingpostgres 28936 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38549) PARSE waitingpostgres 28938 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38551) PARSE waitingpostgres 28940 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38553) PARSE waitingpostgres 28942 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38555) PARSE waitingpostgres 28947 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38558) PARSE waitingpostgres 28948 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38559) PARSE waitingpostgres 28949 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38560) PARSE waitingpostgres 28950 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38561) PARSE waitingpostgres 28951 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38562) PARSE waitingpostgres 28952 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38564) PARSE waitingpostgres 28957 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38568) PARSE waitingpostgres 28961 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38570) PARSE waitingpostgres 28965 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38575) PARSE waitingpostgres 28967 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38577) PARSE waitingpostgres 28968 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38578) PARSE waitingpostgres 28969 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38579) PARSE waitingpostgres 28970 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38580) PARSE waitingpostgres 28971 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38581) PARSE waitingpostgres 28974 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38582) PARSE waitingpostgres 28975 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38583) PARSE waitingpostgres 28977 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38585) PARSE waitingpostgres 28978 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38586) PARSE waitingpostgres 28979 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38587) PARSE waitingpostgres 28980 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38588) PARSE waitingpostgres 28981 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38589) PARSE waitingpostgres 28982 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38590) PARSE waitingpostgres 28983 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38591) PARSE waitingpostgres 28984 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38592) PARSE waitingpostgres 28986 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38594) PARSE waitingpostgres 28987 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38595) PARSE waitingpostgres 28988 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38596) PARSE waitingpostgres 28991 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38599) PARSE waitingpostgres 28992 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38600) PARSE waitingpostgres 28993 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38601) PARSE waitingpostgres 28995 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38603) PARSE waitingpostgres 28999 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38605) PARSE waitingpostgres 29002 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38608) PARSE waitingpostgres 29003 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38609) PARSE waitingpostgres 29005 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38611) PARSE waitingpostgres 29013 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38615) SELECT waitingpostgres 29046 2467 0 11:56 ? 00:00:00 postgres: argos_admin vacia 127.0.0.1(38634) SELECT waitingroot 29071 6468 0 11:56 pts/2 00:00:00 grep postgres--On Tue, Jan 10, 2017 at 11:56 AM, Edmundo Robles <edmundo@xxxxxxxxxxxx> wrote:how can i detect and cancel the process??--
Perhaps this scripts will help:
SELECT c.datname,
c.pid as pid,
c.client_addr,
c.usename as user,
c.query,
CASE WHEN c.waiting = TRUE
THEN 'BLOCKED'
ELSE 'no'
END as waiting,
l.pid as blocked_by,
c.query_start,
current_timestamp - c.query_start as duration
FROM pg_stat_activity c
LEFT JOIN pg_locks l1 ON (c.pid = l1.pid and not l1.granted)
LEFT JOIN pg_locks l2 on (l1.relation = l2.relation and l2.granted)
LEFT JOIN pg_stat_activity l ON (l2.pid = l.pid)
LEFT JOIN pg_stat_user_tables t ON (l1.relation = t.relid)
WHERE pg_backend_pid() <> c.pid
ORDER BY datname,
query_start;
SELECT c.datname,
c.pid as pid,
c.client_addr,
c.usename as user,
c.query,
CASE WHEN c.waiting = TRUE
THEN 'BLOCKED'
ELSE 'no'
END as waiting,
l.pid as blocked_by,
c.query_start,
current_timestamp - c.query_start as duration
FROM pg_stat_activity c
LEFT JOIN pg_locks l1 ON (c.pid = l1.pid and not l1.granted)
LEFT JOIN pg_locks l2 on (l1.relation = l2.relation and l2.granted)
LEFT JOIN pg_stat_activity l ON (l2.pid = l.pid)
LEFT JOIN pg_stat_user_tables t ON (l1.relation = t.relid)
WHERE pg_backend_pid() <> c.pid
ORDER BY datname,
query_start;
--
Melvin Davidson
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.
I reserve the right to fantasize. Whether or not you
wish to share my fantasy is entirely up to you.