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 1r1xdY-00ETOe-28 for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Nov 2023 23:43:36 +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 1r1xdW-008cwG-Bg for pgsql-bugs@arkaria.postgresql.org; Sat, 11 Nov 2023 23:43:34 +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.94.2) (envelope-from ) id 1r1xdW-008cw7-2u for pgsql-bugs@lists.postgresql.org; Sat, 11 Nov 2023 23:43:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r1xdP-0057rX-W3 for pgsql-bugs@lists.postgresql.org; Sat, 11 Nov 2023 23:43:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3ABNhQTs1605686; Sat, 11 Nov 2023 18:43:27 -0500 From: Tom Lane To: Hans Buschmann cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: AW: BUG #18189: Value partitioned tables: Upd ERROR: more than one row returned by a subquery used as an expression In-reply-to: <8c6d3b59e47943efbba984c532424163@nidsa.net> References: <18189-816907aeaa0114e4@postgresql.org>,<1377901.1699629535@sss.pgh.pa.us> <8c6d3b59e47943efbba984c532424163@nidsa.net> Comments: In-reply-to Hans Buschmann message dated "Sat, 11 Nov 2023 08:54:40 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1605684.1699746206.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sat, 11 Nov 2023 18:43:26 -0500 Message-ID: <1605685.1699746206@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hans Buschmann writes: > I sent a "reply to all" mail after I received the Bug-reporting mail (WH= Y after a longer time of clearance??) yesterday at 15:50 CET. > It contained all 5 attachments just under 10 MB and I received the the c= opy sent to myself. So I thought all is OK. > Today I noticed, that this mail doesn't appear in buglist #18189 and to= tally disappeared for the community !!! > It seems there are mechanisms behind the scenes, that are not documented= nor obvious for gentle users trying to ameliorate the software... I think those messages are just hung up in moderation. If you're not subscribed to pgsql-bugs, whatever you send will be held for moderator approval (a sadly-necessary spam defense). Anyway, the error is coming out of this bit: ,qoffs as ( select ... ,(((((ra -(select ra_base from qsum))*1000000000000)::bigint)>>15)&((1::bi= gint<<31)-1))::int as ira ... "(select ra_base from qsum)" certainly is a "sub-select used as an expression", and I guess the difference between your smaller and larger datasets is how many rows the qsum CTE produces. If I'm reading it right, that'll produce one row for each distinct value of "(source_id >> 35+12)&((1<<16)-1)". regards, tom lane