Re: SQL conformity regarding SQLSTATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jürgen Purtz <juergen(at)purtz(dot)de>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: SQL conformity regarding SQLSTATE
Date: 2017-12-21 16:50:32
Message-ID: 2414.1513875032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

=?UTF-8?Q?J=c3=bcrgen_Purtz?= <juergen(at)purtz(dot)de> writes:
> I rearranged 'errcodes.txt' according to SQLSTATE without eliminating
> any row. Please read section 42 and its comments carefully. Maybe you
> want to rearrange the 4 rows which have no fourth column. The attachment
> contains the changes as raw file and as patch.

I looked at this a bit and am completely unwilling to split up the
ERRCODE_UNDEFINED_xxx and ERRCODE_DUPLICATE_xxx codes as you propose.
I think it's important to keep them together so that programmers looking
at the list will select the right one. It's easy to foresee someone
mistakenly using the generic ERRCODE_UNDEFINED_OBJECT code if the one they
should have used is some distance away. Some of the other places where
numeric code order is violated are probably there for similar reasons
about keeping logically related codes together. (I think others are just
a result of SQL99 having listed the codes in a random order to begin
with...)

I think what might make sense is to rewrite generate-errcodes-table.pl
so that it sorts the entries for itself rather than relying on the
input file to determine the order.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jürgen Purtz 2017-12-22 17:15:43 Re: SQL conformity regarding SQLSTATE
Previous Message Jürgen Purtz 2017-12-21 10:44:46 Re: SQL conformity regarding SQLSTATE