PL/Perl Question

Started by Hitesh Patelalmost 25 years ago3 messagesgeneral
Jump to latest
#1Hitesh Patel
hitesh@presys.com

I need to be able to execute SQL commands from inside a plperl function and
can't figure if I can do this. Also.. after executing the query I need to be
able to grab the number of tuples returned and there values.. how would I go
about doing this.. any help would be appreciated.

--
Hitesh Patel
hitesh@presys.com

#2Doug McNaught
doug@wireboard.com
In reply to: Hitesh Patel (#1)
Re: PL/Perl Question

Hitesh Patel <hitesh@presys.com> writes:

I need to be able to execute SQL commands from inside a plperl
function and can't figure if I can do this. Also.. after executing
the query I need to be able to grab the number of tuples returned
and there values.. how would I go about doing this.. any help would
be appreciated.

As I understand it, PL/Perl doesn't currently have an interface to the
server backend, so all you can really do with it is string and number
manipulation. You'll have to use Tcl or PL/PGSQL for your functions.

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time... --Dylan

#3Travis Bauer
trbauer@indiana.edu
In reply to: Hitesh Patel (#1)
Re: PL/Perl Question

I think this is problematic with the default compilation fo PL/Perl.
The perl interpretor you get in a plperl function is inside of a
"sandbox" (can't remember the official name) where it is limited
to only a relatively small set of functions. I don't think that
SQL commands are included.
--
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------

Hitesh Patel (hitesh@presys.com) wrote:

Show quoted text

I need to be able to execute SQL commands from inside a plperl function and
can't figure if I can do this. Also.. after executing the query I need to be
able to grab the number of tuples returned and there values.. how would I go
about doing this.. any help would be appreciated.

--
Hitesh Patel
hitesh@presys.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html