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

From Pavel Stehule
Subject Re: the case for machine-readable error fields
Date
Msg-id 162867790908050429x734c7da0xfb32162fac53d088@mail.gmail.com
Whole thread Raw
In response to Re: the case for machine-readable error fields  (Sam Mason <sam@samason.me.uk>)
Responses Re: the case for machine-readable error fields
List pgsql-hackers
>
> What are people doing with parsing error messages for "column names for
> datatype mismatches"?  I can't imagine any of my code being able to do
> anything sensible in such a case.  If it's things like people giving
> dates to the database in an incorrect format then that's what they get
> for not doing input validation isn't it?
>

When you have a full set of constraint, then you don't need to
validate input. Just you will execute statement. When execution is
correct, then all is ok, when not, then you have to recheck message,
err code, ... and you have to verify, so some exception is expected or
not. This is programming based on exceptions. Some better structured
information helps. And what's more - this should be in conformity with
ANSI SQL.

regards
Pavel Stehule


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: machine-readable explain output v4
Next
From: Magnus Hagander
Date:
Subject: Adding error message "source"