Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UidOe-0003wJ-Ds for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2013 04:26:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1UidOd-0001Aw-Qy for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2013 04:26:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1UidOd-0001AZ-5B for pgsql-bugs@postgresql.org; Sat, 01 Jun 2013 04:26:27 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UidOU-0006TI-7S for pgsql-bugs@postgresql.org; Sat, 01 Jun 2013 04:26:26 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id r514QAl27940 for ; Fri, 31 May 2013 21:26:10 -0700 Message-ID: <51A977E2.6030101@hogranch.com> Date: Fri, 31 May 2013 21:26:10 -0700 From: John R Pierce User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #8191: Wrong bit conversion References: <11097.1370036031@sss.pgh.pa.us> <7A3A36FE51533446AAB1EA0F6069AC8C40A5B460@HEXBOSSSERVER.hexboss.local> <51A9406B.9040908@hogranch.com> <51A947D1.50205@archidevsys.co.nz> In-Reply-To: <51A947D1.50205@archidevsys.co.nz> Content-Type: multipart/alternative; boundary="------------010706090908010805090108" X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -3.0 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------010706090908010805090108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 5/31/2013 6:01 PM, Gavin Flower wrote: >> SQL's BIT type is big endian, a hangover from its IBM mainframe >> heritage. >> >> >> >> >> > I don't think it has anything to do with byte sex (I know of 3 ways to > store integers in memory, and I suspect there are more !). I was thinking of bit sex, not byte. IBM numbers bits such that bit 0 is the most significant bit of a word. -- john r pierce 37N 122W somewhere on the middle of the left coast --------------010706090908010805090108 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 5/31/2013 6:01 PM, Gavin Flower wrote:
SQL's BIT type is big endian, a hangover from its IBM mainframe heritage.





I don't think it has anything to do with byte sex (I know of 3 ways to store integers in memory, and I suspect there are more !).

I was thinking of bit sex, not byte.

IBM numbers bits such that bit 0 is the most significant bit of a word.


-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast
--------------010706090908010805090108--