Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKk6Z-0007u1-G5 for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jan 2023 18:02:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKk6Y-0007vy-4X for pgsql-admin@arkaria.postgresql.org; Wed, 25 Jan 2023 18:02:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKk6X-0007vp-O9 for pgsql-admin@lists.postgresql.org; Wed, 25 Jan 2023 18:02:37 +0000 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pKk6R-0004XG-6h for pgsql-admin@lists.postgresql.org; Wed, 25 Jan 2023 18:02:36 +0000 Received: by mail-ot1-x32a.google.com with SMTP id 39-20020a9d032a000000b006884aad0b15so1617706otv.12 for ; Wed, 25 Jan 2023 10:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=ptyUNRj6DZU8maGF2YvDlXzPt62hEG17XA1pEVbp7sM=; b=A8aksJ0kcyKicSFSv/hoYUkO/kPlbU4i6AYkOECtfO0ckroc4gq9kni0sHwbg73PPY 2ohsRDkv22gxDSv1xF+rj+AjpR3Se+7QJn9Mh2ikDzsYbu2vFdBtaokLIJXESi2IIxfD d1eAnjMc2fQUwbpp1rEkyi6MM85Ft3AKl8gxBCmrIgI2pbmeaevfFZEnqtkuXvYBYqJV T4tANTda3ULkEWrWcVpz43dkxXAVmkTyIFgQeA2SBGYZnBCFLP5vE2LQrUJEgXuNwnCq uy3PMiwG9RJ5qYebcE+Wu26RPJq4vELS7dBqFrdkQV17RZFdemAIu+TOf9dEmLjLJe9V icjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=ptyUNRj6DZU8maGF2YvDlXzPt62hEG17XA1pEVbp7sM=; b=UJJJ5xkkxD16jLhzMZCeBakQyHYJgYI5M1hfTGj6+23LwMYoXMUcnPkrnKLT+uBjxd fSD6T6bee4shacxJAzZ5rHt/BLJAeKzGxT6hDgdWKATwVuWZLVokHQnR+vgdM0VBFpre M2u0SvU0w0reBOXB85zot2zTZSkn1RnU0LBVibVxBKhMhGQ5asz+Nc0hEv0scg1oGJaS xNkycSqJxym5Aog9Obcsda2c1DQIf57ksNfW8cupQ1vfMX0Zb7l/XNdvPIXAL9o6idSy ncwWSiz8zUhdByqQ51NCSmbUYMP7Qzmv9OGUacNPZjpoj03Wkb6ME6TiPO8herCZellu oYBg== X-Gm-Message-State: AFqh2ko4pyUvZ8kt2pIsY/0AexjLGVNs1h8EQSSJKFuGuVbz8j8uHdor 1UE73uU+czgKDcAjvVSlZgkeuGXS3bo= X-Google-Smtp-Source: AMrXdXuk5k2a4DVXc/2ekvzQWIflW1d922Kr7fRjS41iLuWIsMByBdnkSyjZ1OLSjKOZn5S7CE37UA== X-Received: by 2002:a05:6830:4486:b0:684:e29a:e236 with SMTP id r6-20020a056830448600b00684e29ae236mr18336302otv.4.1674669750315; Wed, 25 Jan 2023 10:02:30 -0800 (PST) Received: from [192.168.1.66] (108-250-206-84.lightspeed.nworla.sbcglobal.net. [108.250.206.84]) by smtp.googlemail.com with ESMTPSA id g16-20020a9d6490000000b00684e09b43bdsm2439280otl.13.2023.01.25.10.02.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Jan 2023 10:02:29 -0800 (PST) Content-Type: multipart/alternative; boundary="------------rT5SP0HGVV702M3Q6OhObXIh" Message-ID: <05d32b82-e944-15d4-b769-464e7c21175f@gmail.com> Date: Wed, 25 Jan 2023 12:02:29 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Long running queries Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------rT5SP0HGVV702M3Q6OhObXIh Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/25/23 11:55, Clive Swan wrote: > Greetings > SQL Server has a handy SQL "tool" to spot expensive and/or long running > queries. > > Is there a similar query/tool for Postgresql?? pg_stat_activity lists all of the *currently running* queries (among the columns in the table are query string, database name, user name, transaction start time and query start time). -- Born in Arizona, moved to Babylonia. --------------rT5SP0HGVV702M3Q6OhObXIh Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1/25/23 11:55, Clive Swan wrote:
GreetingsĀ 
SQL Server has a handy SQL "tool" to spot expensive and/or long running queries.

Is there a similar query/tool for Postgresql??

pg_stat_activity lists all of the currently running queries (among the columns in the table are query string, database name, user name, transaction start time and query start time).

--
Born in Arizona, moved to Babylonia.
--------------rT5SP0HGVV702M3Q6OhObXIh--