On Jul 21, 2009, at 6:39 PM, Alvaro Herrera wrote:

Alexey Klyukin wrote:

Attached is a patch (HEAD) that sets errcontext with PL/Perl function
name, making a distinction between compilation and execution stages,
fixes error messages where function name was already included in the
message itself and updates regression tests. I'll appreciate any
suggestions on how to improve it.

Hmm, in plperl_exec_callback(), does the global variable work if you
call one plperl function from another?

PL/Perl functions can't call each other directly. I don't see any problems with SPI calls:

test=# create function perl_log1() returns void language plperl as $$
test$# elog(NOTICE, "Test from function one");
test$# $$
test-# ;
CREATE FUNCTION

test=# create function perl_log2() returns void language plperl as $ $ elog (NOTICE, "Test from function two");
my $rv = spi_exec_query('SELECT * FROM perl_log1()');
$$;
CREATE FUNCTION

test=# select perl_log2();
NOTICE:  Test from function two
CONTEXT:  PL/Perl function "perl_log2"
NOTICE:  Test from function one
CONTEXT:  PL/Perl function "perl_log1"
SQL statement "SELECT * FROM perl_log1()"
PL/Perl function "perl_log1"
 perl_log2
-----------

(1 row)


--
Alexey Klyukin       http://www.CommandPrompt.com
The PostgreSQL Company - Command Prompt, Inc.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to