Re: Patch: show relation and tuple infos of a lock to acquire - Mailing list pgsql-hackers

From Christian Kruse
Subject Re: Patch: show relation and tuple infos of a lock to acquire
Date
Msg-id 20140227104427.GD24373@defunct.ch
Whole thread Raw
In response to Re: Patch: show relation and tuple infos of a lock to acquire  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Patch: show relation and tuple infos of a lock to acquire  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Patch: show relation and tuple infos of a lock to acquire  (Amit Kapila <amit.kapila16@gmail.com>)
Re: Patch: show relation and tuple infos of a lock to acquire  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Hi,

On 25/02/14 16:11, Robert Haas wrote:
> On Mon, Feb 24, 2014 at 10:13 AM, Christian Kruse
> <christian@2ndquadrant.com> wrote:
> > To be honest, I don't like the idea of setting up this error context
> > only for log_lock_wait messages. This sounds unnecessary complex to me
> > and I think that in the few cases where this message doesn't add a
> > value (and thus is useless) don't justify such complexity.
>
> Reading this over, I'm not sure I understand why this is a CONTEXT at
> all and not just a DETAIL for the particular error message that it's
> supposed to be decorating.  Generally CONTEXT should be used for
> information that will be relevant to all errors in a given code path,
> and DETAIL for extra information specific to a particular error.

Because there is more than one scenario where this context is useful,
not just log_lock_wait messages.

> If we're going to stick with CONTEXT, we could rephrase it like this:
>
> CONTEXT: while attempting to lock tuple (1,2) in relation with OID 3456
>
> or when the relation name is known:
>
> CONTEXT: while attempting to lock tuple (1,2) in relation "public"."foo"

Accepted. Patch attached.

> >> Displaying whole tuple doesn't seem to be the most right way
> >> to get debug information and especially in this case we are
> >> already displaying tuple offset(ctid) which is unique identity
> >> to identify a tuple. It seems to me that it is sufficient to display
> >> unique value of tuple if present.
> >> I understand that there is no clear issue here, so may be if others also
> >> share their opinion then it will be quite easy to take a call.
>
> I wouldn't be inclined to dump the whole tuple under any
> circumstances.  That could be a lot more data than what you want
> dumped in your log.  The PK could already be somewhat unreasonably
> large, but the whole tuple could be a lot more unreasonably large.

Well, as I already stated: we don't. I copied the behavior we use in
CHECK constraints (ExecBuildSlotValueDescription()).

Best regards,

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


Attachment

pgsql-hackers by date:

Previous
From: Emre Hasegeli
Date:
Subject: Re: GiST support for inet datatypes
Next
From: Dimitri Fontaine
Date:
Subject: Re: extension_control_path