The PostgreSql documentation does not seem to mention a special class range for custom error codes. Has any been defined or is there an unofficial agreement on a specific class range?
At the bottom of the first section on this page there is some oblique, and indeed rather unspecific, reference to custom error codes. My approach for custom error codes:
As an example, start with a character for your app: "T". Then a two-char error class: "3G". Then a sequential code "A0"-"A9", "B0"-"B9", etc. Yields T3GA0, T3GA1, etc.
But as Craig Ringer indicated in his comment to the OP, some better guidance on the topic might be useful. Keep in mind though that such guidance would hardly solve the issue, unless a global registry is made of error ranges for common extensions. I am doubtful that such a registry will be made, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With