Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: plperl_error_callback_v2.diff
Description: application/octet-stream (16.8 KB)

In response to

Responses

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group