Re: SQLState - Mailing list pgsql-patches

From Tom Lane
Subject Re: SQLState
Date
Msg-id 19595.1084333460@sss.pgh.pa.us
Whole thread Raw
In response to Re: SQLState  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> On Tue, 2004-05-11 at 22:07, Mahesh Swamy wrote:
>> 1/ Is there a convention for creating sub-class codes.

> The only convention I can see is that subclass values not defined by the
> SQL specification begin with 'P'.

The collection of SQLSTATEs defined by the standard itself is, um,
minimalistic.  We have borrowed freely from DB2 and other
implementations in creating the set used by PG 7.4, and then added some
of our own.  I believe we've used 'P' subclass codes for all the ones
we invented (other than XX000 which seemed appropriate for totally-
zonked-out conditions).

I would advise taking a good look at other DBs to see if you can find a
usable SQLSTATE before you go inventing new ones.  If you do have to
invent a new one then use a 'P' code.  This is a shared namespace after
all, so we shouldn't randomly use up new ranges of codes.

> (This ought to be documented; barring any objections, I'll commit a
> patch stating this in errcodes.h explicitly).

Okay, but I thought it was explained somewhere already.  I might be
mistaken about that though...

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: SQLState
Next
From: "Mahesh Swamy"
Date:
Subject: Re: SQLState