Search Postgresql Archives

Catching internal error ID's to throw custom errors. Is it possib le in PostGreSQL?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Title: Catching internal error ID's to throw custom errors. Is it possible in PostGreSQL?

I have a lot of plpgsql functions and I would like to catch the original postgresql error and, based on that value, to throw with a raise or something my custom error. In SQL Server, for example, I have the sysmessages table in which I have all the possible values if the original errors. I catch that value (named @@error) and I call a function who have a parameter this value and who will return my custom value. This kind of error treatment permit me to have the same error ID's in Oracle, SQL Server and DB2, using a raise with the same error value. Is it possible to do the same in PostGreSQL using plpgsql language.

Thanks in advanced.

Stefan Ardeleanu
Database Expert / Business Analyst
SIVECO Romania SA

Business Address:       8-10 Bd. Mareşal Averescu
71316  Bucureşti, Sector 1, România
Web: http://www.siveco.ro

Business 1:    +40 (21) 224 2531
Business 2:    +40 (21) 224 2577
Business Fax:  +40 (21) 224 4108



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux