Обсуждение: Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

Поиск
Список
Период
Сортировка

Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Andrew Dunstan
Дата:
On 01/23/2013 10:12 AM, Alvaro Herrera wrote:
> Improve concurrency of foreign key locking

This error message change looks rather odd, and has my head spinning a bit:

-                    errmsg("SELECT FOR UPDATE/SHARE cannot be applied 
to the nullable side of an outer join")));
+                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY 
SHARE cannot be applied to the nullable side of an outer join")))

Can't we do better than that?

(It's also broken my FDW check, but I'll fix that when this is sorted out)

cheers

andrew




Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Andres Freund
Дата:
On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
> 
> On 01/23/2013 10:12 AM, Alvaro Herrera wrote:
> >Improve concurrency of foreign key locking
> 
> This error message change looks rather odd, and has my head spinning a bit:
> 
> -                    errmsg("SELECT FOR UPDATE/SHARE cannot be applied to
> the nullable side of an outer join")));
> +                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE
> cannot be applied to the nullable side of an outer join")))
> 
> Can't we do better than that?

I don't really see how? I don't think listing only the current locklevel
really is an improvement and something like "SELECT ... FOR $locktype
cannot .." seem uncommon enough in pg error messages to be strange.
Now I aggree that listing all those locklevels isn't that nice, but I
don't really have a better idea.

Andres

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Tom Lane
Дата:
Andres Freund <andres@2ndquadrant.com> writes:
> On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
>> This error message change looks rather odd, and has my head spinning a bit:
>> 
>> -                    errmsg("SELECT FOR UPDATE/SHARE cannot be applied to
>> the nullable side of an outer join")));
>> +                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE
>> cannot be applied to the nullable side of an outer join")))
>> 
>> Can't we do better than that?

> I don't really see how? I don't think listing only the current locklevel
> really is an improvement and something like "SELECT ... FOR $locktype
> cannot .." seem uncommon enough in pg error messages to be strange.
> Now I aggree that listing all those locklevels isn't that nice, but I
> don't really have a better idea.

I don't really see what's wrong with the original spelling of the
message.  The fact that you can now insert KEY in there doesn't really
affect anything for the purposes of this error.
        regards, tom lane



Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Simon Riggs
Дата:
On 23 January 2013 17:15, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
>>
>> On 01/23/2013 10:12 AM, Alvaro Herrera wrote:
>> >Improve concurrency of foreign key locking
>>
>> This error message change looks rather odd, and has my head spinning a bit:
>>
>> -                    errmsg("SELECT FOR UPDATE/SHARE cannot be applied to
>> the nullable side of an outer join")));
>> +                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE
>> cannot be applied to the nullable side of an outer join")))
>>
>> Can't we do better than that?
>
> I don't really see how? I don't think listing only the current locklevel
> really is an improvement and something like "SELECT ... FOR $locktype
> cannot .." seem uncommon enough in pg error messages to be strange.
> Now I aggree that listing all those locklevels isn't that nice, but I
> don't really have a better idea.

"row level locks cannot be applied to the NULLable side of an outer join"
Hint: there are no rows to lock


-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Alvaro Herrera
Дата:
Andrew Dunstan wrote:
>
> On 01/23/2013 10:12 AM, Alvaro Herrera wrote:
> >Improve concurrency of foreign key locking
>
> This error message change looks rather odd, and has my head spinning a bit:
>
> -                    errmsg("SELECT FOR UPDATE/SHARE cannot be
> applied to the nullable side of an outer join")));
> +                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY
> SHARE cannot be applied to the nullable side of an outer join")))
>
> Can't we do better than that?

Basically this message says "a SELECT with a locking clause attached
cannot be blah blah".  There are many messages that had the original
code saying "SELECT FOR UPDATE cannot be blah blah", which was later
(8.1) updated to say "SELECT FOR UPDATE/SHARE cannot be blah blah".  I
expanded them using the same logic, but maybe there's a better
suggestion?  Note that the SELECT reference page now has a subsection
called "The locking clause", so maybe it's okay to use that term now.



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



Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Andrew Dunstan
Дата:
On 01/23/2013 12:48 PM, Simon Riggs wrote:
> On 23 January 2013 17:15, Andres Freund <andres@2ndquadrant.com> wrote:
>> On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
>>> On 01/23/2013 10:12 AM, Alvaro Herrera wrote:
>>>> Improve concurrency of foreign key locking
>>> This error message change looks rather odd, and has my head spinning a bit:
>>>
>>> -                    errmsg("SELECT FOR UPDATE/SHARE cannot be applied to
>>> the nullable side of an outer join")));
>>> +                    errmsg("SELECT FOR UPDATE/SHARE/KEY UPDATE/KEY SHARE
>>> cannot be applied to the nullable side of an outer join")))
>>>
>>> Can't we do better than that?
>> I don't really see how? I don't think listing only the current locklevel
>> really is an improvement and something like "SELECT ... FOR $locktype
>> cannot .." seem uncommon enough in pg error messages to be strange.
>> Now I aggree that listing all those locklevels isn't that nice, but I
>> don't really have a better idea.
> "row level locks cannot be applied to the NULLable side of an outer join"
> Hint: there are no rows to lock
>

Yeah, this is really more informative than either, I think.

cheers

andrew




Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Tom Lane
Дата:
Simon Riggs <simon@2ndQuadrant.com> writes:
> On 23 January 2013 17:15, Andres Freund <andres@2ndquadrant.com> wrote:
>> On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
>>> Can't we do better than that?

> "row level locks cannot be applied to the NULLable side of an outer join"

I think it should read "row-level locks cannot ...", but otherwise this
is a fine idea.

> Hint: there are no rows to lock

This bit doesn't seem to be either accurate or helpful, though.
        regards, tom lane



Re: [COMMITTERS] pgsql: Improve concurrency of foreign key locking

От
Alvaro Herrera
Дата:
Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.com> writes:
> > On 23 January 2013 17:15, Andres Freund <andres@2ndquadrant.com> wrote:
> >> On 2013-01-23 11:58:28 -0500, Andrew Dunstan wrote:
> >>> Can't we do better than that?
>
> > "row level locks cannot be applied to the NULLable side of an outer join"
>
> I think it should read "row-level locks cannot ...", but otherwise this
> is a fine idea.

Thanks for the suggestion, I have changed all these messages.

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