Re: SQLState

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Mahesh Swamy <maheshs(at)fast(dot)fujitsu(dot)com(dot)au>, osspatches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: SQLState
Date: 2004-05-12 03:44:20
Message-ID: 19595.1084333460@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Mahesh Swamy 2004-05-12 04:55:53 Re: SQLState
Previous Message Neil Conway 2004-05-12 02:56:29 Re: SQLState