Re: REFERENCES error message complaint, suggestion

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Greg Stark <gsstark(at)MIT(dot)EDU>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: REFERENCES error message complaint, suggestion
Date: 2004-03-05 02:39:04
Message-ID: 20040304203904.C31644@mofo.meme.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 2004.03.04 17:19 Greg Stark wrote:
> Greg Stark <gsstark(at)MIT(dot)EDU> writes:
>
> > It's great to know which constraint was violated but that doesn't
> really help
> > you figure out *why* it was violated.
>
> On further thought it would never be feasible to do what the other
> poster is
> really looking for. At least for table constraints it would require
> poking
> through the expression to determine which columns might have caused
> the
> violation.

This is exactly the kind of thing that exception handling mechanisims
with throws, catches, and first class continuations are great for.
Even without continuations, each exception handler can translate the
error it catches into something appropriate at the current level
of abstraction, what went wrong from it's perspective,
it means to the result that will be produced, and what
steps might be taken to avoid the problem. If each layer
of abstraction, application, SQL, constraint, etc., takes the care
to catch it's errors and pass them on you wind up with an
annoted stack trace, the topmost level of which should be
meaningful to the end-user.

Of course most programmers don't bother to even check for error
conditons
when they are returned as results, so it's probably too
much to expect that the users will ever get good errors,
but it should be possible for postgresql to deliver something
of a stack trace. ?

BTW, I like the idea of two classes of error messages, one to be
logged for the DBA and one for the user.

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2004-03-05 02:52:45 ERROR: function round(double precision, integer) does not exist - WTF?
Previous Message Dann Corbit 2004-03-05 02:35:57 Re: ERROR: function round(double precision, integer) does not exist - WTF?