Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRbFr-0006dZ-Kw for pgsql-sql@arkaria.postgresql.org; Wed, 20 Dec 2017 10:05:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eRbFr-00040s-8T for pgsql-sql@arkaria.postgresql.org; Wed, 20 Dec 2017 10:05:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eRbFq-00040g-Vx for pgsql-sql@lists.postgresql.org; Wed, 20 Dec 2017 10:05:39 +0000 Received: from mout.kundenserver.de ([212.227.126.135]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eRbFo-00059N-H7 for pgsql-sql@lists.postgresql.org; Wed, 20 Dec 2017 10:05:37 +0000 Received: from [192.168.178.20] ([77.178.114.24]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MdZN2-1edkqv2EDE-00POYJ for ; Wed, 20 Dec 2017 11:05:33 +0100 Subject: Re: SQL conformity regarding SQLSTATE To: pgsql-sql@lists.postgresql.org References: <31999.1513697414@sss.pgh.pa.us> From: =?UTF-8?Q?J=c3=bcrgen_Purtz?= Message-ID: Date: Wed, 20 Dec 2017 11:08:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <31999.1513697414@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Provags-ID: V03:K0:Z4ZmuQDEXaZ3qqHB6nE78+LFuVcd5AlPdRSx79IDZ2m4/bu2Xqo GRvq9nz3sKT7FNfExg5ptIobbskKcxPLGYDYwJjZjpSK2hER5J0Il6E8WeNPvp0s3NxxA8j PhOHeCkOJvLSlWHSkYJU+HFGOQPGoB6Lkjj8l7JHOX+YTQZhCm19fX/eyAhUWr+YW//fl6C v+WstyURV5gj0+yFwVmGQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:7gGxc5RhYjI=:3q4xsyvDc8EP0Cd93e7L7W QWaQqDjFCCvJbLtxDhkYFrNdZXKQIOIo90X3c07omFT7cf/2IR1j94RTXFeIGxJmZzBuROJIF 4glR0T1WQrWiV3QmgDdW7j0XxCSiByupWFeGyPTp42cqOfvT/1nyhR1HRsSnV16c0CTORxrKy odS6GGEfGtTHsrK2T68eonqH2pSPhr0IIRlK+CAWYywIaG7nNkRRw8q4WDVHAvyVMTw5C2RK3 Y4c0VQaP4Je/jXQbc/YB4D8QdrWEEIWEWaLWeEds4X25U+hXIzei0Ll1+rjcDDRxzlTMek2Sm A5rvd1+NxggYoR1vNWJB4ysQCPw2DkAZLSU6CDWVl5eqP2Z0Gp/VN9EvURLqEoIcvwOw6MsO2 dqICN+dpqaWO/4r/iGUfjEaYJeYTfqCEbfK6H0SfpfTlYxz/T1Ctk+tnnyXANKOP5dP+s3YSq MmSnEwQpHK8uGlP7HN5PLHKeSHT9zj83ILJo3aweNndGZ+i2zg/xLvNFcZQuauGshd0V1zTlD VBmLXTWLkwXpfH7RL/wk1rAm00pJGnSfCJOeWQs8SIC9CNV2/JA1qD+1wh+9T8zbYqnE2RXQO 92z8TMN6hyUqc9U6OhtdTbdSV1RADhAf1k7ijTtjoM9mqiezKDaGirMdpxOp6Hbqt0DT22Ova qAWxdr30wQUgKqV0KUIPcSy5G3rMYHTJ6or3aGa+AQXD7xjl0dUcImzv0nQ+XVmzya455N6ZX 189PXfnYxi1eS+OmYdzTdNgtTtl5aXpunyo5qBy4w7RZev3V68MvuDHXrEg= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > There are various SQLSTATE codes that we borrowed from DB2 and other > RDBMSes; to the extent that those violate the spec, we're in good > company. In good company or in bad society ??? >> Here is a list of values, which violate the above rule as the values are >> in the range which is reserved for the standard but (actually) are not >> defined by the standard. I compared our list in the version 10 >> documentation with the SQL:2011 standard. (Unfortunately I have no >> access to SQL:2016. Maybe, some values of my list are defined there.) >> 01008, 03000, 0B000, 23502 - 23514, 39001, 42501 - 42939, F0000, F0001. > Actually, I'm pretty sure we were looking at SQL99 when we made our > original list. I see 01008, 03000, 0B000, and 39001 there; are they > really not in later specs? Yes, I double checked it. Maybe they where used in one of the parts 5, 6, 7,8, or 12. Those parts are no longer part of the SQL standard. 0B000 may be switched into the 23 class? 39001 "invalid SQLSTATE returned" sounds dubious for me - it declares itself to be 'invalid'. > The 23xxx and 42xxx codes are there because SQL99 provides ridiculously > few subclasses for those classes. I think many of those might've been > borrowed from DB2, but in any case they're in the legal range for > extension subclasses, so I don't follow your complaint. OK, my error. 23xxx and 42xxx subclasses are in the legal range. > Class F0 seems like a mistake ... maybe we could get away with changing > those two assignments, since it seems unlikely that any client code is > looking for those values. > >> b) Shall we add a comment into 'errcodes.txt' to remind everybody to the >> mentioned rule? > You mean the one at lines 64ff? Yes. But as you said: it is still there. No action necessary. >> c) Is it possible to rearrange the rows of 'errcode.txt' in a way that >> reflects the natural sort order of SQLSTATE? > I'd have said it was already. There is no sorting of subclasses within their class in 'errcode.txt'. Summary: 01008, 03000, 0B000, 39001, F0000, and F0001 do not conform to the standard. Kind regards Jürgen Purtz