Re: [PATCH] SQL function to report log message

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, dinesh kumar <dineshkumar02(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] SQL function to report log message
Date: 2015-09-09 23:19:03
Message-ID: 55F0BE67.1080209@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9/9/15 5:27 PM, Robert Haas wrote:
>> Sure, it’s a clear fact that, we can implement this function with RAISE
>> >statements.
> Given that, I suggest we just forget the whole thing.

Except that you can't use a variable to control the log level in a
plpgsql RAISE, so then you end up with a CASE statement. That perhaps
wouldn't be so bad, until you also want to optionally report detail,
hint, and/or errcode. So trying to create a generic wrapper around RAISE
is decidedly non-trivial. Another option is removing those restrictions
from RAISE, but it seems a bit silly to take the hit of firing up a
plpgsql function for this.

So I think there is value in a SQL equivalent to RAISE. I'm not thrilled
by piling another hack onto the horribly inadequate errlevel
infrastructure, but at least Dinesh's "MESSAGE" idea is essentially just
side-stepping that hole instead of digging it deeper.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-09-09 23:32:10 Re: [PATCH] SQL function to report log message
Previous Message Robert Haas 2015-09-09 22:46:30 Re: Parallel Seq Scan