# LibPQ.Errors.PQResultError

**URL:** <https://discourse.julialang.org/t/libpq-errors-pqresulterror/52649>\
**Category:** Data\
**Created:** [December 31, 2020, 9:27am UTC](https://discourse.julialang.org/t/libpq-errors-pqresulterror/52649 "2020-12-31T09:27:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Laco\_Kovac](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laco_kovac/32/20684_2.png) [@Laco\_Kovac](https://discourse.julialang.org/u/Laco_Kovac)\
**Post date:** [December 31, 2020, 9:27am UTC](https://discourse.julialang.org/t/libpq-errors-pqresulterror/52649/1 "2020-12-31T09:27:53Z")

</div>

I am quite new to Julia and I suspect my question is probably rather about how to access/analyze data type/structure.

Using LibPQ, execute is throwing an exception exc.

typeof(exc) is LibPQ.Errors.PQResultError{LibPQ.Errors.C22,LibPQ.Errors.E22001}

exc is LibPQ.Errors.StringDataRightTruncation(“ERROR: value too long for type character varying(10)\n”)

I do understand what the error means (INSERT INTO where the value of string in the column is larger that allowed 10 characters). But I want to analyze/parse the error programatically and properly indicate to the caller what went wrong.

How to analyze/parse this exc variable? What would be the proper condition to determine that it is LibPQ.Errors.StringDataRightTruncation? And how could I access/parse that string “ERROR: value too long for type character varying(10)\n”?

Thank you,

LK
