Re: Patch: show relation and tuple infos of a lock to acquire

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Christian Kruse <christian(at)2ndQuadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: show relation and tuple infos of a lock to acquire
Date: 2013-12-31 16:36:36
Message-ID: 25797.1388507796@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On 31 December 2013 09:12, Christian Kruse <christian(at)2ndquadrant(dot)com> wrote:
>> Output with patch:
>>
>> LOG: process 24774 acquired ShareLock on transaction 696 after 11688.720 ms
>> CONTEXT: relation name: foo (OID 16385)
>> tuple (ctid (0,1)): (1)

> That is useful info.

> I think the message should be changed to say this only, without a context line

> LOG: process 24774 acquired ShareLock on relation "foo" (OID 16385)
> tuple (0,1) after 11688.720 ms

> My reason is that pid 24774 was waiting for a *tuple lock* and it was
> eventually granted, so thats what it should say.

No, that wasn't what it was waiting for, and lying to the user like that
isn't going to make things better.

Christian's idea of a context line seems plausible to me. I don't
care for this implementation too much --- a global variable? Ick.
Make a wrapper function for XactLockTableWait instead, please.
And I'm not real sure that showing the whole tuple contents is a good
thing; I can see people calling that a security leak, not to mention
that the performance consequences could be dire.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2013-12-31 17:06:55 Re: Patch: show relation and tuple infos of a lock to acquire
Previous Message Pavel Stehule 2013-12-31 16:03:33 Re: [PATCH] Store Extension Options