Received: from smtp25.baruch.cuny.edu (smtp25.baruch.cuny.edu [150.210.155.201]) by hub.org (8.9.3/8.9.3) with SMTP id SAA14248 for ; Thu, 27 Jan 2000 18:06:10 -0500 (EST) (envelope-from vince@baruch.cuny.edu) Received: (qmail 8067 invoked by uid 0); 27 Jan 2000 22:58:39 -0000 Received: from newton.baruch.cuny.edu (HELO baruch.cuny.edu) (150.210.155.202) by smtp25.baruch.cuny.edu with SMTP; 27 Jan 2000 22:58:39 -0000 Received: (qmail 29277 invoked by uid 1000); 27 Jan 2000 23:06:07 -0000 Date: Thu, 27 Jan 2000 18:06:07 -0500 From: Vince Gonzalez To: pgsql-sql@postgresql.org Subject: User-defined error messages Message-ID: <20000127180607.C24586@newton.baruch.cuny.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hello, Is it possible to create user-defined error messages in functions? For example, I'd like for an update to a table to fail with a message like 'You need to check your privileges' as opposed to 'Permission Denied'. I'd like to avoid parsing the messages actually returned by the server, as these could change from revision to revision. Should I do this by crafting each function to return an error code that I define, and then use that code to index a table? I'm interested to hear any solutions people may have come up with. I seem to remember there being some sort of exception facility, but I can't remember where I may have seen it (or I could be crazy). My application is written in Java, if that matters. --vince