| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Sam Mason <sam(at)samason(dot)me(dot)uk> |
| Cc: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: the case for machine-readable error fields |
| Date: | 2009-08-05 18:25:20 |
| Message-ID: | 26677.1249496720@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Sam Mason <sam(at)samason(dot)me(dot)uk> writes:
> On Wed, Aug 05, 2009 at 12:41:30PM -0500, Kevin Grittner wrote:
>> Anyway, it was a bad suggestion that we provide a way to specify a
>> SQLSTATE to use for a constraint failure. I do think that some field
>> which could be used for that purpose would be good. Preferably
>> something which could be specified in the declaration of the
>> constraint.
> I still stand by my assertion that the constraint name is sufficient for
> the original purpose.
Yeah. Changing the SQLSTATE for a given error seems much more likely
to break things than to be helpful. It does make sense to be able to
extract the constraint name for a constraint-related error without
having to make unsafe assumptions about the spelling of the
human-readable error message, though.
Peter pointed out upthread that the SQL standard already calls out some
things that should be available in this way --- has anyone studied that
yet?
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2009-08-05 18:29:15 | Re: the case for machine-readable error fields |
| Previous Message | Jeff Davis | 2009-08-05 18:17:09 | Re: Prefix support for synonym dictionary |