Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVeyx-0004Rj-H8 for pgsql-general@arkaria.postgresql.org; Fri, 24 Feb 2023 20:47:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pVeyw-0007xP-2p for pgsql-general@arkaria.postgresql.org; Fri, 24 Feb 2023 20:47:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVeyv-0007ws-MV for pgsql-general@lists.postgresql.org; Fri, 24 Feb 2023 20:47:53 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pVeyr-0005ff-Mf for pgsql-general@lists.postgresql.org; Fri, 24 Feb 2023 20:47:53 +0000 Received: by mail-pj1-x102d.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so479341pja.5 for ; Fri, 24 Feb 2023 12:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=3MnL7CBd44h8HMSE9AT0UbGWM5a0A/Juxj+dO/y3m3k=; b=iyH6F2ec53dL/Er96/7EwD0d45bnFvt1VkTUQf6mECaIA6Nzj7B4hKLBI2zuPvFd7e /mEA9m8jZCb9cexEBj5itmSe/ElCoKZGhpfRM54SZiaQKUwb8T4C71QxkB0NLCbnufAF U1XtRpfvh89TulHoyJ5mfNr9iOgoAEuJXi7xMHe0nT8ILlz+SqVF2Y7+cwLyCPZB8FFz Zj3tSYBNJES13oKAzXgr9FRbEE3CuW0F/znm1/SDvCDSHEDfdpXirA5bu9/KGSZLqD1R fRYpnP1xlBknHJGFTpvrY5rIG2LgEb9trxDYDnnwFE0YYw0e1b0I7qgWtppuAOZEOt9E godw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3MnL7CBd44h8HMSE9AT0UbGWM5a0A/Juxj+dO/y3m3k=; b=XnfXmvlKVSpiG2744Q51ZY9ayXUxgwpTi1gNSb05aqtXp5KSkFiz6CMtv04ky22P7N fEiIYc6QACSWhx39/rOG2E+63L9uUuvtIBO8SO9bskRq/LhARgcOiRPBbvgkRQm3xhB3 l/Mit+oUykuAqwolZszrSEoruJx+4O6VLh9kgyLCblZa6QIlTG2S9gh+tRFEAZXxyYRc 2g+QDZILAiEQ8XMgPC3DrguFYTZ1YvbsE66mkgsRcF+1Pj5nFshsScWBKlMP84jkiHIg QDdUOUcbyOvhZ5z8VbK6bgauD6nKvpzUxj4prTwXeksGrtPEXtGJsE4d6V8gxI45yPaM BoFg== X-Gm-Message-State: AO0yUKU6hA23QQfVOborS8//Ta+M8aOD7p2UT2byx9t8bPG8pgkFv0Sg eSz/Re8BOtmtr6n49+HN2xh4rWMD39UR6w== X-Google-Smtp-Source: AK7set9bwxroa0KHQLsdKa4q20EMpvNkoJUll2YXoyBgZbDuumAPTBVrBXqC6Qt/v+30JiCfUHbxLg== X-Received: by 2002:a17:903:6cb:b0:19c:d23e:5298 with SMTP id kj11-20020a17090306cb00b0019cd23e5298mr3600594plb.68.1677271667083; Fri, 24 Feb 2023 12:47:47 -0800 (PST) Received: from ?IPV6:2601:681:5a00:f790:5174:ea4d:d32f:e6ae? ([2601:681:5a00:f790:5174:ea4d:d32f:e6ae]) by smtp.gmail.com with ESMTPSA id y5-20020a170902d64500b0019a7385079esm9720349plh.123.2023.02.24.12.47.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Feb 2023 12:47:46 -0800 (PST) Content-Type: multipart/alternative; boundary="------------UUzoyv32VNbSsI3mAqnradRj" Message-ID: Date: Fri, 24 Feb 2023 13:47:44 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-CA To: "pgsql-generallists.postgresql.org" From: Rob Sargent Subject: curiosity in default column header List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------UUzoyv32VNbSsI3mAqnradRj Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit riftehr=> select ascii(substring('sadb', 2,1));  ascii -------     97 (1 row) riftehr=> select 24::bit(8);    bit ----------  00011000 (1 row) riftehr=> select ascii(substring('sadb', 2,1))::bit(8);   ascii ----------  01100001 (1 row) Why is the last one headed "ascii" and not "bit"? --------------UUzoyv32VNbSsI3mAqnradRj Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit riftehr=> select ascii(substring('sadb', 2,1));
 ascii
-------
    97
(1 row)

riftehr=> select 24::bit(8);
   bit    
----------
 00011000
(1 row)

riftehr=> select ascii(substring('sadb', 2,1))::bit(8);
  ascii   
----------
 01100001
(1 row)

Why is the last one headed "ascii" and not "bit"?
--------------UUzoyv32VNbSsI3mAqnradRj--