Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4BaR-006yps-2Z for pgsql-admin@arkaria.postgresql.org; Wed, 09 Sep 2026 06:15:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4BZQ-00BvoJ-0V for pgsql-admin@arkaria.postgresql.org; Wed, 09 Sep 2026 06:14:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4BZP-00BvoA-2S for pgsql-admin@lists.postgresql.org; Wed, 09 Sep 2026 06:14:07 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4BZO-00000004ils-0PrW for pgsql-admin@lists.postgresql.org; Wed, 09 Sep 2026 06:14:06 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4995b0343c1so76225315e9.3 for ; Tue, 08 Sep 2026 23:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1788934444; x=1789539244; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:from:to :cc:subject:date:message-id:reply-to:content-type; bh=3g6jp9A4X4+23Bi1APa46tvf9TCOzfU2G3UgL8F+yQs=; b=rCrHPjy8BWcieCrnxbLrYpHOz+mZW4ccOR46+7esroefGFWmVytaprmtIQ731fo7Y7 g7TVSnILCe4a962fvA8uUc54faMpaVXCFjKq9Ch2KxaHR9Ih+oFP15TFoBCgJlsZi5E2 vvCXlEl+PcWFiMyYhzL3yHmwgzMEqmm1n2Gblw8EvvstlEx7EttaLQQ5Muxr8JT/XwK1 IX2P1+UlmhN9wFAOynVz94/RNBG/0Urlf93dCc7cMYJxjjQ5amwBQYTZhMgwfH+ZRmfo fRGrLbMllAWgmN9LTgxbeiAdIEqz+yovAHzejsoLFrE86TtahrXWnuB+38+6pwHRC/12 Ytpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788934444; x=1789539244; h=mime-version:user-agent:content-transfer-encoding:content-type :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3g6jp9A4X4+23Bi1APa46tvf9TCOzfU2G3UgL8F+yQs=; b=rZp4+Mc0DHDNH1VG4WkdDOz5D204aErt/tX8zmgWDGnsWpyYNqy4lmnVNuXW1TH8SE Ntaoh45FprKWjPn7BZbdpjwjKD9k1HpR9RRy41+AXNAJtae/WoaLu3pSOY07VuhtGlFP bjUx9+4UdLFVjFwdKCGzyei4Q9oLHpwC7LDHb6/F9ZVR10TrdR0OxQATjdJnZcfSwrig V2ubbfZsrvfbnALZ8FLzswnNJymfNTcN0d+BfpuuhvCX71BiU4kAHSQZDykB3yIT4/Rl A5RnH2e+ph1LFj8a8k94IOqp6lh3vETAnEaVI6Ri9Ncszpe//Y42xiUP3BsY1j7eCJi1 uInA== X-Gm-Message-State: AFuF++lnHdTHFSReYPPuuYMO/wvuXV1MsdISqm8yrBOJqJA3t3DlrBH8 QAMp2NyiooIECEi31pGg/l8spN0LgTFBiKe9FNPyVmdbVUB8iuTlmp0aI3koA5pvv3w= X-Gm-Gg: AYBFou0VrXn/2e0gst6ZQ4sJ+oW5kuOaHQlir/nB5UxPJsbafeQtHSt8s5WWYM8UdR+ WEIPqTQOk9xy8i9z8cKhCU9R2TPGNQlVinmtmwBzPyioaslZH0lLqcNYu5Xi1lnqlSxvsfcKQ3Y yrPBxE5q2qMXTBiPIRVVdkBPkn3NDStrDwOD0mqXiGJhSKwmbVKZVxTjVCwrHIbiWtrMywcQXii mC+mTf5t5qU2km4EbycKiAlXopqn8wGZ6E/zEV/SdV3r+xzS/e5nNX0OKg+kUWm6R+hvG/sXsj9 02622SeUcHNjWZd9vixc8IUiJE7qtAVejk14REISUH7LWASjfw2lwkPT14I1y8VJZxBjtsxrPpf TNaRXs47JUQ32ZpQXtiJHs5gnGLP929JZjT0l3XkAfw+VlPF9NfpUR4RY1K1ULa9U8iO+IUlI4p TDOwgxRayjEVQO01PN1jEqM3MXChu/+3pSty5kuwh/+qpxjj9Ea/h5z/LeNj+zB6Y3qLkVQlaJH Z8mtPf/tHBng+T9qadtps/ucF8= X-Received: by 2002:a05:600c:3550:b0:49c:d019:70c5 with SMTP id 5b1f17b1804b1-49cf7f4a6cfmr299396095e9.0.1788934443714; Tue, 08 Sep 2026 23:14:03 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:70:a992:6e8e:8ce:5907:a549]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee7fec25sm622864035e9.13.2026.09.08.23.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2026 23:14:03 -0700 (PDT) Message-ID: <6c4d94fe1b8aa391ae63c3863193fec4b9c87e16.camel@cybertec.at> Subject: Re: fetch all from "" From: Laurenz Albe To: Ganesh Korde , Siraj G Cc: Pgsql-admin Date: Wed, 09 Sep 2026 08:14:02 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-1.fc44) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2026-09-09 at 10:42 +0530, Ganesh Korde wrote: > On Wed, 9 Sept 2026, 10:01 am Siraj G, wrote: > > Postgres version 14 and the instance is a GCP cloud SQL. > >=20 > > We have several application connections in ACTIVE state for several hou= rs and the query text shows just fetch all from "". > > What does it indicate? Could these sessions be in hung state? >=20 > What do you see in wait events column in pg_stat_activity? A good hint for debugging, but let me answer the question as it is: Your application uses cursors to query the database. A cursor is first declared (that statement contains the query text), and then you fetch the result rows from the cursor. The query is taking a long time, but you don't get to see the query text - that is only known to the executing session. You should ask the people who wrote the application. If that is not feasible, you could set log_min_duration_statement =3D 0 log_line_prefix =3D '%m [%v] ' if you can afford to log all statements. Then locate a slow FETCH statement in the log (you have to wait until it completes) and find the preceding statements with the same virtual transaction ID. One of them will be the statement that declared the cursor. If you are more adventurous, you can break into one of the stalled backends with a debugger and tickle out the statement. That requires knowledge of PostgreSQL's internals. Yours, Laurenz Albe