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 1t3nJ8-00Egma-CB for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Oct 2024 02:10:38 +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 1t3nJ6-00FhW0-9N for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Oct 2024 02:10:36 +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 1t3nJ5-00FhVs-NU for pgsql-hackers@lists.postgresql.org; Thu, 24 Oct 2024 02:10:36 +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 1t3nJ3-002Xnl-GS for pgsql-hackers@lists.postgresql.org; Thu, 24 Oct 2024 02:10:34 +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 49O2AVte2351537; Wed, 23 Oct 2024 22:10:31 -0400 From: Tom Lane To: Michel Pelletier cc: pgsql-hackers@lists.postgresql.org Subject: Re: Using Expanded Objects other than Arrays from plpgsql In-reply-to: References: <1342498.1729444411@sss.pgh.pa.us> <1445998.1729482404@sss.pgh.pa.us> <2062830.1729625620@sss.pgh.pa.us> <2259890.1729696885@sss.pgh.pa.us> Comments: In-reply-to Michel Pelletier message dated "Wed, 23 Oct 2024 18:39:03 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2351535.1729735831.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 23 Oct 2024 22:10:31 -0400 Message-ID: <2351536.1729735831@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michel Pelletier writes: > On Wed, Oct 23, 2024 at 8:21 AM Tom Lane wrote: >> Another thing that confuses me is why there's a second flatten_matrix >> operation happening here. Shouldn't set_element return its result >> as a R/W expanded object? > That confuses me too, and my default assumption is always that I'm doing it > wrong. set_element does return a R/W object afaict, here is the return: > https://github.com/OneSparse/OneSparse/blob/main/src/matrix.c#L1726 Hmph. That seems right. Can you add errbacktrace() to your logging ereports, in hopes of seeing how we're getting to flatten_matrix? Or break there with gdb for a more complete/reliable stack trace. regards, tom lane