pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Konrad Witaszczyk <def@FreeBSD.org>
To: pgsql-general@lists.postgresql.org
Subject: SQL statement in an error report for deferred constraint violation.
Date: Thu, 5 Apr 2018 02:04:59 +0200
Message-ID: <b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org> (raw)

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

Attachments:

  signature.asc (application/pgp-signature, 962B) download

view thread (2+ messages)  latest in thread

Message-ID: <b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org>
Permalink:  ../b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org/
Also on:    postgresql.org/message-id/b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: def@FreeBSD.org
  Subject: Re: SQL statement in an error report for deferred constraint violation.
  In-Reply-To: <b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org>
  References: <b2c97292-d907-ba72-e25d-299e2b30f868@FreeBSD.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox