geting results of query in plperl

From: stan <stanb(at)panix(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: geting results of query in plperl
Date: 2020-03-06 12:57:55
Message-ID: 20200306125755.GA3273@panix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrei Zhidenkov 2020-03-06 14:24:22 Limit transaction lifetime
Previous Message Schmid Andreas 2020-03-06 11:04:50 How to allow users to create and modify tables only in their own schemas, but with generic table owner