Re: the case for machine-readable error fields - Mailing list pgsql-hackers

From Sam Mason
Subject Re: the case for machine-readable error fields
Date
Msg-id 20090806163452.GV5407@samason.me.uk
Whole thread Raw
In response to Re: the case for machine-readable error fields  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Thu, Aug 06, 2009 at 11:41:55AM +0200, Pavel Stehule wrote:
> typically in SQL/PSM (stored procedures - look on GET DIAGNOSTICS
> statement in plpgsql doc), maybe in ecpg. Other's environments raise
> exception - so you can get some data from exception or from special
> structures related to environment - php, ruby, .NET etc

Sorry, I should have said that I saw how it was used in stored
procedures.  My interest was in getting the client doing something
interesting, if you've already got the complexity of a stored procedure
it shouldn't be to hard to teach it where the problem is.


One thing I didn't see any comment on was on the fact that I think
CREATE UNIQUE INDEX is really creating a constraint--it's just not
showing up as one.  For the constraint name to be sent back in the case
of an error I think this needs to be changed.

Triggers (and other domain specific code) seem less important here as
they can always fail with whatever error is appropriate.

--  Sam  http://samason.me.uk /


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: dblink bulk operations
Next
From: David Fetter
Date:
Subject: Re: dblink bulk operations