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.98.2) (envelope-from ) id 1xUSnL-00000000z6r-2XXd for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Nov 2026 17:53:08 +0000 Received: from localhost ([127.0.0.1]:37008 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xUSnK-0000000AfRN-3U8E for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Nov 2026 17:53:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:37532) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUSnK-0000000AfRB-2Gah for pgsql-bugs@lists.postgresql.org; Fri, 20 Nov 2026 17:53:06 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xUSnE-00000000mk9-0WCy for pgsql-bugs@lists.postgresql.org; Fri, 20 Nov 2026 17:53:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 6AKHqsKB1536294; Fri, 20 Nov 2026 12:52:54 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 sss.pgh.pa.us 6AKHqsKB1536294 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sss.pgh.pa.us; s=default; t=1795197174; bh=wmcAo69wwHAMNsC2zEsQdNdkZ6ts67OnT/2QMQr001Y=; h=From:To:cc:Subject:In-reply-to:References:Date:From; b=GNsGf+IjIO6PHnsaynqEynGTJJDlZET/08ek4VOmqNYsTjfFIFutC2VWSiwakMc43 LG+LINNOpRihAj1QILOxHDXek4c+zKrX3QzOhrobiO5rIMpBK37Ugh1HSLQL7IZDyz OnrKMMlwG0qhF6QhPNmCEdJsXBEiTOcXQ2sWhI4c= From: Tom Lane To: Peter Eisentraut cc: tharakan@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19923: SEARCH/CYCLE with DISTINCT in the recursive term: rows depend on input order In-reply-to: <1535856.1795196546@sss.pgh.pa.us> References: <19923-24cef1e958fa2370@postgresql.org> <1535856.1795196546@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 20 Nov 2026 12:42:26 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1536292.1795197174.1@sss.pgh.pa.us> Date: Fri, 20 Nov 2026 12:52:54 -0500 Message-ID: <1536293.1795197174@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > ... The only way that this is stable > is if the extra columns are absolutely, positively guaranteed to > be immutable functions of the regular columns. Do we want to > assume that? The main hazard I see is that we allow a much > wider range of and > than the spec contemplates, eg we will happily take > "timestamptz 'now'" as a mark value. Oh wait, you can reach the issue without anything terribly fancy, because while we require the mark values to be constants, we don't insist on them being of identical type, and will insert a cast instead. If the cast is mutable, say timestamp to timestamptz, then so is the cycle expression. I'm not sure we have any casts that are volatile enough to change output mid-query, but we don't forbid that. regards, tom lane