This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -h localhost -U gestor02aws -d kikker_production -c "SELECT pg_terminate_backend(pid), pid, application_name, state, (NOW() - backend_start) as atual, REGEXP_REPLACE(REPLACE(query, E'\n', ' '), ' ', '', 'g') as query FROM pg_stat_activity WHERE state = 'active' AND application_name LIKE 'Passenger%' and (query like '%stock_ruptures%' or query like '%ruptures_alert%') ORDER BY backend_start DESC;" |