Neil Conway <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to