Re: [PATCH] SQL function to report log message

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: [PATCH] SQL function to report log message
Дата
Msg-id 55F0BE67.1080209@BlueTreble.com
обсуждение исходный текст
Ответ на Re: [PATCH] SQL function to report log message  (Robert Haas <robertmhaas@gmail.com>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Parallel Seq Scan
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] SQL function to report log message