Skip site navigation (1) Skip section navigation (2)

custom error messages/numbers

From: "BARTKO Zoltan" <bartko(dot)zoltan(at)pobox(dot)sk>
To: <pgsql-general(at)postgresql(dot)org>
Subject: custom error messages/numbers
Date: 2004-05-27 16:26:53
Message-ID: 001601c44407$6cf6f400$0e5d10ac@antik.org (view raw or flat)
Thread:
Lists: pgsql-general
Folks,

I am developing an app for PostgreSQL, entirely with stored functions (somewhat resembling the object-oriented approach. In fact it is not an app, just an API). All my functions return an integer value - 0 if the function was successful, another value otherwise.

Until now, all parameter checking was done manually in the stored function (if param is null then return -8; end if; etc.) This makes things quite lengthy.

I know about check constraints. However, upon error they throw an error message and abort the current transaction, So my question is: is there any possible way of throwing my own error messages upon a check constraint violation? 

Thank you very much

Zoltan Bartko

Responses

pgsql-general by date

Next:From: Jeannie StevensonDate: 2004-05-27 16:38:43
Subject: multiple count functions in a select statement
Previous:From: Ulrich MeisDate: 2004-05-27 16:25:16
Subject: Howto handle views/Rules Privileges

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group