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

From: Kääriäinen Anssi <anssi(dot)kaariainen(at)thl(dot)fi>
To: Jan Kundrát <jkt(at)flaska(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <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-10 14:27:57
Message-ID: BC19EF15D84DC143A22D6A8F2590F0A78864133112@EXMAIL.stakes.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


"""
What I want to find in the end is something which tells me "this row
causes the error". Unfortunately, as the new row of the table with the
constraint is not yet on disk, it doesn't really have its own ctid, and
therefore I cannot report that. (Which makes sense, obviously.)
"""

Would an error with the row's PK value be useful? Something like "row
with primary key 'pk_val' fails check 'foo_check'". That would be limited
in size, yet give some context.

There are two problems I can see:
- The PK value doesn't necessarily identify the row in any useful
manner (SERIAL primary key in INSERT).
- The table might lack PK constraint (skip the detail in this case?)

- Anssi

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2011-11-10 14:47:57 Re: Disable OpenSSL compression
Previous Message Andrew Dunstan 2011-11-10 14:22:51 Re: Disable OpenSSL compression