Re: errcontext support in PL/Perl

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: errcontext support in PL/Perl
Date: 2009-07-21 17:54:29
Message-ID: 87A4CA1B-004C-4B22-ACDD-887C8386C137@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Attachment Content-Type Size
plperl_error_callback_v2.diff application/octet-stream 16.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message ANdreas Wenk 2009-07-21 19:44:52 psql \du and \dg is the same - pg 8.4
Previous Message Jeff Davis 2009-07-21 17:40:27 Re: WIP: Deferrable unique constraints