# DBI and postgres

**URL:** <https://rubytalk.org/t/dbi-and-postgres/16520>\
**Category:** ruby-talk\
**Created:** [16 February 2005 12:14 UTC](https://rubytalk.org/t/dbi-and-postgres/16520 "2005-02-16T12:14:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominik\_Werder2](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@Dominik\_Werder2](https://rubytalk.org/u/Dominik_Werder2)\
**Post date:** [16 February 2005 12:14 UTC](https://rubytalk.org/t/dbi-and-postgres/16520/1 "2005-02-16T12:14:50Z")

</div>

Hello!

Is there a way to get the numerical error codes when using postgres with the DBI module?  
#errstr contains the error as a string but #err is nil here..

thanks!  
Dominik

---

<div class="post-metadata">

**Author:** ![George5](https://avatars.discourse-cdn.com/v4/letter/g/7c8e57/32.png) [@George5](https://rubytalk.org/u/George5)\
**Post date:** [16 February 2005 16:41 UTC](https://rubytalk.org/t/dbi-and-postgres/16520/2 "2005-02-16T16:41:05Z")

</div>

Dominik Werder wrote:

> Hello!
> 
> Is there a way to get the numerical error codes when using postgres with the DBI module?

It would only be possible if the underlying postgres C library provides these information in it's PGError class. The Postgres Frontend/Backend Protocol provides these information (at least in version 3.0).

Regards,

&nbsp;&nbsp;&nbsp;Michael
