Skip site navigation (1) Skip section navigation (2)

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

From: Jan Kundrát <jkt(at)flaska(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Date: 2011-11-07 05:02:27
Message-ID: 4EB76663.2010700@flaska.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,
when I insert/update many rows at once using INSERT ... SELECT into a
table which has plenty of CHECK constraints, the error message that
Postgres returns has no indication of which row failed the constraint
check. The attached patch tries to provide information in a similar way
to how duplicate items in a UNIQUE constraint are handled.

Originally, I tried to simply check the new row's t_ctid, but it was
always (0,0) -- I guess that's expected, maybe it's still in memory at
that time and maybe such nodes don't have a ctid assigned yet.

Please let me know if this patch is suitable for inclusion. It's based
on REL9_0_STABLE, because that's the version I'm running.

I'd like to thank intgr on IRC for his feedback when I was wondering
about the t_ctid.

With kind regards,
Jan

-- 
Trojita, a fast e-mail client -- http://trojita.flaska.net/

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2011-11-07 05:13:05
Subject: -Wcast-qual cleanup, part 1
Previous:From: Mark KirkwoodDate: 2011-11-07 04:55:48
Subject: Re: Measuring relation free space

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group