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.94.2) (envelope-from ) id 1uO51o-00Egpp-JE for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 01:40:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uO51l-00G7MM-2j for pgsql-bugs@arkaria.postgresql.org; Sun, 08 Jun 2025 01:40:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uO51k-00G7MD-QE for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 01:40:49 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uO51j-000nUE-0A for pgsql-bugs@lists.postgresql.org; Sun, 08 Jun 2025 01:40:48 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-8731c4ba046so279839439f.3 for ; Sat, 07 Jun 2025 18:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749346844; x=1749951644; darn=lists.postgresql.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=ytGc0aCpwaI9/ugyX/W8Z9WmFvp6X6kC6H6po3mN6pM=; b=johsftob6zCQFw019M1Eou4J+nfYc2Tw86quJj/lejU8xyxBKbUImME0KAsqJHKM3/ mm7nKhPyGPO5B0nBD1rxZLc7osD6h1Flx4ohN4FW4XQIlthAb+R8vft5vEHF6jspd9H0 HAFQxIDo3s+pB3J5UggACZOZ114OUtlpOVUgWsV+2lzXAaR9O6w9V/VH+c1SLMiqaPg0 f7UWk37zqQ10hoqQAadJfnX91+sXPjtD3wvWvVWBDjoEFlogcWUB89Vw81IHCXx54oRQ A+6M7RFnxFtfuMg+a7DNiq4TMB3F8YD5GP1nv23UmJNenjCDeYOhMt+dt604VPQ9hjsV rxcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749346844; x=1749951644; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ytGc0aCpwaI9/ugyX/W8Z9WmFvp6X6kC6H6po3mN6pM=; b=glYPH6jOlFLmvBVph+FFknd7FlRWflX59lTVpRtD5tWSO/d3FP5XXGMKxsP13j7nOD cwy5l1BIIQ1rJMJFmtR2A8U8nkuHfM2P1NndisjHdix9t/0Of3utD1OJrXpV8szqs+ny I0AlCkcxWeXGQyYW+Q9/pGzRgCxDzWcNIYHKiIQlfW0TZINwCnxjFc05aK9kEi8+S0hH EjDNKgaBerFHFozWNaXbtpFUdcABUBMJQj1HBiT5mhQnBq7ecSH+YdKsbn0u/E3J1nPN c8nrhY49YJ71VsrweLKuLWZMnW7j3k6cxkRZ7d3kEyHJ0warjZYGxGCpKpf+9FfWomYC 95sw== X-Gm-Message-State: AOJu0YzevnFeVSswAwxBJYl4ALZi3OqiSiCP6OHjD4fqsdskDTPT+H2U 2B24k5xI1OtUHYzbeOCVSjnRzdyX4KoZLFFfpwfN74+jtT5DpiN/6U5kiE2JMA== X-Gm-Gg: ASbGncv8nQ/AMO90a4wwRwnDDnBaUnwUor34d9vkYcUwpUiIfEWeRgaxznv1R+AzTPJ CiLPVzn/+/6MdYjNIDf1JXOHmF32h+V17lkLouklqOsaF9QvlLMrjDEVy6MZI3gzKsSv+O77/JF 5p+s/LJtxrQpO30+1MuO6bXUVy50axpSNlTeVGnAqyAqEHYcCWQBuVyOWY2aoXHOufriUmLaK3a /qz64/By5ujFc6CbPYy8nNntuLVRHXFCVtohiRsN1W7nXNd03HWkITUUP2oZorAc88dh4yHeOOh qatr4hAPT4jERqeUVwCJ1EMyBTHWEet0hk9deUeabzP8ci/y+AYpaoxhkNGGSGwgK/ELv/10Utt I/T5IL90M X-Google-Smtp-Source: AGHT+IH4qX8wHLNcod7/GBbJFh6vp5SyDNmDmp5M/JVVDNbEhODEEArLYoMxetHADm+5OFO63ElnWA== X-Received: by 2002:a05:6602:4742:b0:85b:3a51:2923 with SMTP id ca18e2360f4ac-873366ed06dmr1095572939f.14.1749346843950; Sat, 07 Jun 2025 18:40:43 -0700 (PDT) Received: from smtpclient.apple ([136.37.106.222]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-87338a1eb84sm96610839f.44.2025.06.07.18.40.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Jun 2025 18:40:43 -0700 (PDT) From: Lowell Hought X-Google-Original-From: Lowell Hought Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Subject: Re: BUG #18950: pgsql function that worked in Postgresql 16 does not return in Postgresql 17 Date: Sat, 7 Jun 2025 20:40:32 -0500 Message-Id: <75D714EA-CD1E-4F80-A2E8-29E378EC2200@gmail.com> References: Cc: pgsql-bugs@lists.postgresql.org In-Reply-To: To: Laurenz Albe X-Mailer: iPhone Mail (22F76) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk If I run the query outside of the function it works as expected. But the fu= nction never returns. Lowell > On Jun 7, 2025, at 7:27=E2=80=AFPM, Laurenz Albe wrote: >=20 > =EF=BB=BFOn Sat, 2025-06-07 at 16:08 +0000, PG Bug reporting form wrote: >> PostgreSQL version: 17.5 >> Operating system: Red Hat Enterprise Linux release 8.10 (Ootpa) >>=20 >> A pgsql function that returns Table is relatively simple. It accepts two= >> arguments; a date and an interval. It uses these to arguments in a query= >> that returns a result set. This function worked in Postgresql 16.1 and >> Postgresql 16.9. However, it does not work in versions 17.0 nor in 17.5 >>=20 >> [function definition] >>=20 >> This is the first time I have ever encountered a bug and so I have no >> experience with reporting it. >=20 > Your function essentially is running a query. > If you run that query outside of the function, does it finish on time? > If not, you have a simpler problem to tackle. >=20 > It need not necessarily be a bug if some queries perform worse in a later > PostgreSQL version. There are too many factors involved in the execution > of a complicated query. To give help, we'd need at least the EXPLAIN > output from the query and the EXPLAIN (ANALYZE, BUFFERS) output from the > query on the old version. >=20 > Yours, > Laurenz Albe