Page 1 of 1

DBExpress Error - Code

Posted: Thu 07 Apr 2022 08:11
by mjoerg
Hello,
Currently we are migrating Oracle to PostgreSQL DBExpress. With Oracle, we were able to categorize DBExpress errors based on the message "ORA-XXXXX" and perform appropriate error handling. We had to do this because of the limitation of DBExpress.

With PostgreSQL, we have the problem that we only get the error message. So we would have to parse all error messages individually. Per error code there are 1:n different PostgreSQL error messages!

Therefore our question to you: Would it be possible to set the error code analog to Oracle at the start of the error message?

For example "PG-22023 input string is too short for datetime format".

Maybe this could be turned on or off per customer with a new connection parameter.

As we have seen in various posts, this new feature would certainly be useful for some other customers as well.

Thanks,
Marcel

Re: DBExpress Error - Code

Posted: Thu 07 Apr 2022 12:38
by evgeniym
Hi Marcel!

Thank you for your inquiry!

Unfortunately, at the moment dbExpress Driver for PostgreSQL lacks functionality that would additionally process errors sent by the PostgreSQL server and add an error code to the message.
If you would like us to implement error message handling and error code addition, please post this suggestion on our user voice forum: https://devart.uservoice.com/forums/104 ... components .

If the proposal receives a lot of votes, we will consider the possibility of its implementation.

Regards,
Evgeniy