Thread: pltcl: sentence improvement

pltcl: sentence improvement

From
Euler Taveira
Date:
Hi,

This simple patch improves a sentence. Spotted while working on translation.


--
    Euler Taveira                   Timbira - http://www.timbira.com.br/
    PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachment

Re: pltcl: sentence improvement

From
Tom Lane
Date:
Euler Taveira <euler@timbira.com.br> writes:
> This simple patch improves a sentence. Spotted while working on translation.

I concur that spelling out "#" as "number" is an improvement, but I'm
curious which backend error you think this matches?

Also, if we're going to change this message at all, I'm inclined to
rewrite it completely, because it doesn't really follow the style
guidelines.  How about "trigger's return list must have even number of
elements"?
        regards, tom lane



Re: pltcl: sentence improvement

From
Euler Taveira
Date:
On 16-09-2015 10:57, Tom Lane wrote:
> Euler Taveira <euler@timbira.com.br> writes:
>> This simple patch improves a sentence. Spotted while working on translation.
>
> I concur that spelling out "#" as "number" is an improvement, but I'm
> curious which backend error you think this matches?
>
It is sort of...

utils/adt/json.c

2088         ereport(ERROR,
2089                 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2090                  errmsg("argument list must have even number of 
elements"),
2091                  errhint("The arguments of json_build_object() must 
consist of alternating keys and values.")));

replication/logical/logicalfuncs.c

361             ereport(ERROR,
362                     (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
363                      errmsg("array must have even number of 
elements")));

> Also, if we're going to change this message at all, I'm inclined to
> rewrite it completely, because it doesn't really follow the style
> guidelines.  How about "trigger's return list must have even number of
> elements"?
>
Works for me.


--    Euler Taveira                   Timbira - http://www.timbira.com.br/   PostgreSQL: Consultoria, Desenvolvimento,
Suporte24x7 e Treinamento
 



Re: pltcl: sentence improvement

From
Tom Lane
Date:
Euler Taveira <euler@timbira.com.br> writes:
> On 16-09-2015 10:57, Tom Lane wrote:
>> Also, if we're going to change this message at all, I'm inclined to
>> rewrite it completely, because it doesn't really follow the style
>> guidelines.  How about "trigger's return list must have even number of
>> elements"?

> Works for me.

Looking around, I noticed a couple of other error messages using "#"
as an abbreviation.  I changed those too.
        regards, tom lane



Re: pltcl: sentence improvement

From
Alvaro Herrera
Date:
Tom Lane wrote:

> Also, if we're going to change this message at all, I'm inclined to
> rewrite it completely, because it doesn't really follow the style
> guidelines.  How about "trigger's return list must have even number of
> elements"?

I agree a full rewrite is sensible, but that particular wording looks
slightly odd to me.  I would either have added an "an", or pluralized
the subject, so either
"trigger's return list must have an even number of elements"
or"trigger's return lists must have even number of elements"

However I notice that the "must have even number" wording (and others
where "must have" is not followed by an indefinite article) is already
used in other places, so maybe it's just an English quirk.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: pltcl: sentence improvement

From
Tom Lane
Date:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I agree a full rewrite is sensible, but that particular wording looks
> slightly odd to me.  I would either have added an "an", or pluralized
> the subject, so either

>  "trigger's return list must have an even number of elements"
> or
>  "trigger's return lists must have even number of elements"

There's only one list involved, so the second doesn't seem right to me.
I don't have a problem with adding "an", but as you say, we elide such
articles elsewhere too.  Feel free to change it if you like.
        regards, tom lane