Re: errcontext support in PL/Perl - Mailing list pgsql-hackers

From Alexey Klyukin
Subject Re: errcontext support in PL/Perl
Date
Msg-id 87A4CA1B-004C-4B22-ACDD-887C8386C137@commandprompt.com
Whole thread Raw
In response to Re: errcontext support in PL/Perl  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: errcontext support in PL/Perl  (Peter Eisentraut <peter_e@gmx.net>)
Re: errcontext support in PL/Perl  (Selena Deckelmann <selenamarie@gmail.com>)
Re: errcontext support in PL/Perl  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Jul 21, 2009, at 7:47 PM, Alexey Klyukin wrote:

>
> On Jul 21, 2009, at 7:20 PM, Alvaro Herrera wrote:
>
>> Alexey Klyukin wrote:
>>
>>> NOTICE:  Test from function one
>>> CONTEXT:  PL/Perl function "perl_log1"
>>> SQL statement "SELECT * FROM perl_log1()"
>>> PL/Perl function "perl_log1"
>>
>> Shouldn't the second "PL/Perl function" line say perl_log2 instead?
>
> Hm, yeah, seems to be a problem. I'll change the callback to avoid
> using global data.

Attached is the updated version of the patch (the original description
is here: http://archives.postgresql.org/pgsql-hackers/2009-07/msg01332.php)
  that doesn't use global variables. It also shows the last line of
the context in the example above correctly:

psql (8.5devel)
Type "help" for help.

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_log2"
  perl_log2
-----------

(1 row)



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


Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: WIP: Deferrable unique constraints
Next
From: ANdreas Wenk
Date:
Subject: psql \du and \dg is the same - pg 8.4