Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Kundrát <jkt(at)flaska(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Date: 2011-11-29 20:09:59
Message-ID: 5747.1322597399@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?UTF-8?B?SmFuIEt1bmRyw6F0?= <jkt(at)flaska(dot)net> writes:
> Attached is a second version of this patch which keeps the size of the
> output at 64 characters per column (which is an arbitrary value defined
> as a const int, which I hope matches your style). Longer values have
> their last three characters replaced by "...", so there's no way to
> distinguish them from a legitimate string that ends with just that.
> There's also no escaping of special-string values, similar to how the
> BuildIndexValueDescription operates.

Applied with some revisions; notably, that I pulled the code out into a
separate subroutine so that it could be used for more than one thing.

I was wondering in particular whether it wouldn't be appropriate to
include the same errdetail in ExecConstraints's other check, the one
for null in not-null columns. Arguably a not-null check is just a
slightly optimized form of a CHECK constraint, and anyway if you think
you need row identification info for a CHECK failure I don't see why
you'd not want it for NOT NULL failure. Comments?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-11-29 20:24:40 Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Previous Message Alexander Shulgin 2011-11-29 20:02:37 Re: Notes on implementing URI syntax for libpq