pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vince Gonzalez <vince@baruch.cuny.edu>
To: pgsql-sql@postgresql.org
Subject: User-defined error messages
Date: Thu, 27 Jan 2000 18:06:07 -0500
Message-ID: <20000127180607.C24586@newton.baruch.cuny.edu> (raw)

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



Message-ID: <20000127180607.C24586@newton.baruch.cuny.edu>
Permalink:  ../20000127180607.C24586@newton.baruch.cuny.edu/
Also on:    postgresql.org/message-id/20000127180607.C24586@newton.baruch.cuny.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: vince@baruch.cuny.edu
  Subject: Re: User-defined error messages
  In-Reply-To: <20000127180607.C24586@newton.baruch.cuny.edu>
  References: <20000127180607.C24586@newton.baruch.cuny.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox