Re: [pgtranslation-translators] Opinions about wording of error messages for bug #3883?

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org, pgtranslation-translators(at)pgfoundry(dot)org
Subject: Opinions about wording of error messages for bug #3883?
Date: 2008-01-30 00:40:46
Message-ID: 28827.1201653646@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

In the recent discussion of bug #3883 we decided that for safety's sake,
TRUNCATE, CLUSTER, and REINDEX ought to error out if there are any
active scans on the table (or index in the case of REINDEX). This is
essentially the same as the test currently applied by ALTER TABLE,
which uses this code:

static void
CheckTableNotInUse(Relation rel)
{
int expected_refcnt;

expected_refcnt = rel->rd_isnailed ? 2 : 1;
if (rel->rd_refcnt != expected_refcnt)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("relation \"%s\" is being used by active queries in this session",
RelationGetRelationName(rel))));

if (AfterTriggerPendingOnRel(RelationGetRelid(rel)))
ereport(ERROR,
(errcode(ERRCODE_OBJECT_IN_USE),
errmsg("cannot alter table \"%s\" because it has pending trigger events",
RelationGetRelationName(rel))));
}

I would like to export this routine and have it be used by all four
commands, instead of duplicating this logic everywhere. However,
that brings up the question of whether the error messages are
generic enough for all four commands; and if not, how we want them
to read. I'm tempted to rephrase both messages along the line of

cannot %s \"%s\" because ...

where the first %s is replaced by a SQL command name, viz ALTER TABLE,
CLUSTER, etc. I'm not sure how nice this is for translation though.

Also, with 8.3 release being so close, it's likely that any change would
not get reflected into translations before release. I don't think
that's a showstopper because these messages should hardly ever be seen
by normal users anyway; but maybe it's a consideration.

Comments, better ideas?

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org, pgtranslation-translators(at)pgfoundry(dot)org
Subject: Re: Opinions about wording of error messages for bug #3883?
Date: 2008-01-30 00:56:23
Message-ID: 20080130005623.GK27546@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> I would like to export this routine and have it be used by all four
> commands, instead of duplicating this logic everywhere. However,
> that brings up the question of whether the error messages are
> generic enough for all four commands; and if not, how we want them
> to read. I'm tempted to rephrase both messages along the line of
>
> cannot %s \"%s\" because ...
>
> where the first %s is replaced by a SQL command name, viz ALTER TABLE,
> CLUSTER, etc. I'm not sure how nice this is for translation though.

I suggest
cannot execute \"%s\" on \"%s\" because ...

> Also, with 8.3 release being so close, it's likely that any change would
> not get reflected into translations before release. I don't think
> that's a showstopper because these messages should hardly ever be seen
> by normal users anyway; but maybe it's a consideration.

I wouldn't worry about that at this point. We didn't declare a string
freeze anyway ...

It will likely be fixed in 8.3.1 for translations where it matters
anyway, if the translator is not able to do it for 8.3. (That's
currently only fr, de and es -- currently even tr is a bit behind).

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, pgtranslation-translators(at)pgfoundry(dot)org
Subject: Re: Opinions about wording of error messages for bug #3883?
Date: 2008-01-30 01:31:07
Message-ID: 206.1201656667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Tom Lane wrote:
>> I'm tempted to rephrase both messages along the line of
>> cannot %s \"%s\" because ...
>>
>> where the first %s is replaced by a SQL command name, viz ALTER TABLE,
>> CLUSTER, etc. I'm not sure how nice this is for translation though.

> I suggest
> cannot execute \"%s\" on \"%s\" because ...

Hmm, why not just

cannot execute %s \"%s\" because ...

?

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgtranslation-translators(at)pgfoundry(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [pgtranslation-translators] Opinions about wording of error messages for bug #3883?
Date: 2008-01-30 03:13:45
Message-ID: 20080130031345.GC22090@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:

> > I suggest
> > cannot execute \"%s\" on \"%s\" because ...
>
> Hmm, why not just
>
> cannot execute %s \"%s\" because ...
>
> ?

Hmm, yeah, that seems fine too. Thinking more about it, from the POV of
the translator probably the three forms are the same because he has all
the elements to construct the phrase however he sees fit.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgtranslation-translators(at)pgfoundry(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [pgtranslation-translators] Opinions about wording of error messages for bug #3883?
Date: 2008-01-30 09:30:08
Message-ID: 47A043A0.3000704@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Tom Lane wrote:
>> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>
>>> I suggest
>>> cannot execute \"%s\" on \"%s\" because ...
>> Hmm, why not just
>>
>> cannot execute %s \"%s\" because ...
>>
>> ?
>
> Hmm, yeah, that seems fine too. Thinking more about it, from the POV of
> the translator probably the three forms are the same because he has all
> the elements to construct the phrase however he sees fit.
>

Alvarro's sentence seems better to me. Anyways, I have no problem with
such a change this near of a release. As Alvarro said, if the
translation of this sentence is not available for 8.3, it can be for
8.3.1. That's not such a big deal.

And thanks for asking translators' opinion on this, I really appreciate.

Regards.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com