Re: PL/PgSQL: RAISE and the number of parameters

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/PgSQL: RAISE and the number of parameters
Date: 2014-09-01 23:02:03
Message-ID: 5404FAEB.5040206@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-08-12 13:23, I wrote:
>> The compile-time raise parameter checking is a good move.
>>
>> 3 minor points:
>>
>> - I would suggest to avoid "continue" within a loop so that the code is
>> simpler to understand, at least for me.
>
> I personally find the code easier to read with the continue.

I've changed the loop slightly. Do you find this more readable than the
way the loop was previously written?

>> - I would suggest to update the documentation accordingly.

I've incorporated these changes into this version of the patch, with
small changes.

On 2014-08-12 15:09, Fabien COELHO wrote:
> I'm not sure why elog is better than ereport in that case: ISTM that
it is
> an error worth reporting if it ever happens, say there is another syntax
> added later on which is not caught for some reason by the compile-time
> check, so I would not change it.

With elog(ERROR, ..) it's still reported, but the user isn't fooled into
thinking that the error is to be expected, and hopefully we would see a
bug report. If it's impossible to tell the two errors apart, we might
have subtly broken code carried around for who knows how long.

Please let me know what you think about this patch. Thanks for your
work so far.

.marko

Attachment Content-Type Size
raise_check_number_of_arguments.v2.patch text/x-patch 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Tiffin 2014-09-02 00:09:51 Re: PL/pgSQL 2
Previous Message Tom Lane 2014-09-01 22:59:51 Re: Patch for psql History Display on MacOSX