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

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: 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-02-03 04:26:34
Message-ID: kekotq$net$3@gonzo.reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2013-01-30, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:
> 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.
>

note also that the "ERROR" "WARNING" "NOTICE" parts are subject to i18n

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2013-02-03 05:06:29 Re: Diferences between IN and EXISTS?
Previous Message Jasen Betts 2013-02-03 04:10:37 Re: finding if a period is multiples of a given interval