Re: Is there a way to add a detail message in a warning with pl/Python?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: daniel(dot)cruz(at)sc(dot)senai(dot)br
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is there a way to add a detail message in a warning with pl/Python?
Date: 2013-01-30 14:55:54
Message-ID: 5109347A.6070303@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/30/2013 02:49 AM, DANIEL CRISTIAN CRUZ wrote:
>
>
> Em 29/01/2013 17:30, Adrian Klaver escreveu:
>> Why not:
>>
>> DO $$
>> plpy.warning('test, detail')
>> $$ LANGUAGE plpythonu;
>>
>> In log:
>>
>> WARNING: test, detail
>>
>
> Because pgBadger doesn't use it this way:
>
> http://dalibo.github.com/pgbadger/example.html#NormalizedErrorsMostFrequentReport

I am not sure how you can determine that from the above. Looks like
pgBadger is searching the detail string and applying a mask when
appropriate i.e ERROR: relation "..." does not exist.

When you use plpy.warning it is going to output WARNING:"Your string".
If you are consistent in your naming of warnings I see no reason it
would not sort.

Worse come to worse you could always ask on the the pgBadger mailing list:
https://listes.dalibo.com/cgi-bin/mailman/listinfo/pgbadger

>
> I read the code yesterday, and didn't find how to get a detail through
> it. Maybe my C knowledge is somewhat broken...
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-01-30 15:18:17 Re: Optimizing select count query which often takes over 10 seconds
Previous Message Tom Lane 2013-01-30 14:54:20 Re: trouble with upgrade from 9.0 (many schemas and tables)