Re: [PATCH] SQL function to report log message

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Fetter <david(at)fetter(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, dinesh kumar <dineshkumar02(at)gmail(dot)com>, 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-10-19 23:59:02
Message-ID: 562583C6.20501@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/19/15 1:09 AM, Pavel Stehule wrote:
> What I was trying to say is that if the argument to a USING
> option
> is NULL then RAISE should skip over it, as if it hadn't
> been applied
> at all. Similar to how the code currently tests for \0.
>
>
> I understand, but I don't prefer this behave. The NULL is
> strange value
> and should be signalized.
>
>
> So instead of raising the message we wanted, we throw a completely
> different exception? How does that make sense?
>
>
> It is partially wrong because we handle all fields same. It has sense
> for "message" fields, and has not sense for other fields. In this case
> the text "NULL" will be better.

I fail to see how doing

HINT: NULL

is much better than just not raising a HINT at all...

> More to the point, if RAISE operated this way then it would be
> trivial to create a fully functional plpgsql wrapper around it.
>
>
> I have a different opinion - better to have propossed function in core.
> What I know, the NULL is not use in Postgres as "ignore value", and I am
> thinking, it is good idea.

Normally I'd agree, but in this case I think it's inline with what the C
code is already doing by testing for \0.

I suppose if we get the function it's not that bad since at least we get
the functionality, so I'll stop arguing it.
--
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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-10-20 00:02:12 Re: ROWS FROM(): A Foolish (In)Consistency?
Previous Message Jim Nasby 2015-10-19 23:55:27 Re: Why no CONSTANT for row variables in plpgsql?