Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jACYI-0008NT-C9 for pgsql-general@arkaria.postgresql.org; Fri, 06 Mar 2020 12:58:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jACYF-0006FP-DZ for pgsql-general@arkaria.postgresql.org; Fri, 06 Mar 2020 12:58:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jACYF-0006FI-3P for pgsql-general@lists.postgresql.org; Fri, 06 Mar 2020 12:58:03 +0000 Received: from mailbackend.panix.com ([166.84.1.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jACYA-0003B1-Sl for pgsql-general@lists.postgresql.org; Fri, 06 Mar 2020 12:58:02 +0000 Received: from panix5.panix.com (panix5.panix.com [166.84.1.5]) by mailbackend.panix.com (Postfix) with ESMTP id 48Ynj01Lpvzwjn for ; Fri, 6 Mar 2020 07:57:56 -0500 (EST) Received: by panix5.panix.com (Postfix, from userid 17622) id 48Ynhz73hBzfYm; Fri, 6 Mar 2020 07:57:55 -0500 (EST) Date: Fri, 6 Mar 2020 07:57:55 -0500 From: stan To: pgsql-general@lists.postgresql.org Subject: geting results of query in plperl Message-ID: <20200306125755.GA3273@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: gVim List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I have looked at: https://www.postgresql.org/docs/8.4/plperl-database.html I am also comfortable querying data from tables in perl. But I do not quite see how to get the results of a query in plperl. Here is what I tried, and it is not working: my $rv2 = spi_exec_query('SELECT current_user'); my $user = $rv2->{rows}[1]->{my_column}; I have used this query in SQL functions, so I know it works. I also ran it in plsql. What do I have wrong here? -- "They that would give up essential liberty for temporary safety deserve neither liberty nor safety." -- Benjamin Franklin