SQL statement in an error report for deferred constraint violation.

From: Konrad Witaszczyk <def(at)FreeBSD(dot)org>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: SQL statement in an error report for deferred constraint violation.
Date: 2018-04-05 00:04:59
Message-ID: b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

While PQresultErrorField() from libpq allows to get context in which an error
occurred for immediate constraints, and thus an SQL statement which caused the
constraint violation, I cannot see any way to find out which SQL statement
caused an error in case of deferred constraints, in particular deferred foreign
key constraints.

Is there any way to check which SQL statement or at least which row violated a
constraint when it's deferred? If not does anyone know why there is such
restriction?

Konrad

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2018-04-05 00:13:36 Re: PgUpgrade bumped my XIDs by ~50M?
Previous Message Bruce Momjian 2018-04-04 23:28:27 Re: PgUpgrade bumped my XIDs by ~50M?