Re: How to determine offending column for insert exceptions

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Shawn Gennaria <sgennaria2(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: How to determine offending column for insert exceptions
Date: 2015-04-21 16:46:35
Message-ID: 20150421164635.GE4369@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Shawn Gennaria wrote:
> OK, I'm looking at
> www.postgresql.org/docs/9.4/interactive/plpgsql-control-structures.html#PLPGSQL-EXCEPTION-DIAGNOSTICS-VALUES
> which I completely missed before. This sounds like my answer, but it's not
> returning anything when I try to extract the COLUMN_NAME.

As far as I recall, COLUMN_NAME is new in 9.4. If you're trying with an
earlier version, you can't get that info other than by parsing the error
message string.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Shawn Gennaria 2015-04-21 16:48:48 Re: How to determine offending column for insert exceptions
Previous Message Shawn Gennaria 2015-04-21 16:37:31 Re: How to determine offending column for insert exceptions