Re: PL/PgSQL: RAISE and the number of parameters - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: PL/PgSQL: RAISE and the number of parameters
Date
Msg-id 5404FAEB.5040206@joh.to
Whole thread Raw
In response to Re: PL/PgSQL: RAISE and the number of parameters  (Marko Tiikkaja <marko@joh.to>)
Responses Re: PL/PgSQL: RAISE and the number of parameters
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch for psql History Display on MacOSX
Next
From: Neil Tiffin
Date:
Subject: Re: PL/pgSQL 2