Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWcpe-003pw2-HZ for pgsql-general@arkaria.postgresql.org; Thu, 17 Aug 2023 13:14:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qWcpb-00HEve-Vo for pgsql-general@arkaria.postgresql.org; Thu, 17 Aug 2023 13:14:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWcpb-00HEvV-7E for pgsql-general@lists.postgresql.org; Thu, 17 Aug 2023 13:14:31 +0000 Received: from mout-u-107.mailbox.org ([80.241.59.207]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWcpT-000d35-Dd for pgsql-general@lists.postgresql.org; Thu, 17 Aug 2023 13:14:29 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4RRQSp0532z9sLw; Thu, 17 Aug 2023 15:14:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1692278058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KbwbQY2dsw9bl8eoLZR7pdMG5X1hpa6MEA7ULUQdISo=; b=ilXhC2cC968v3NO2qbN/i7+6YHdaDMS1+vnw3Vo/c6BnV/VO8aLBZhl0ClLuEsjXAMdQxg XpPsR+OaRaqytFmKeXgW0SYPPtIYcptskMqxWWfWcFByCuX14Wo3NiEq6+jTCmSBuixdJd u/vlgFPkMo2K8NopKWcRye8rkVaqtGkVy5yCjWYi7mdGG6NvsZytXJjaOHBmC/f9WXor7v Q1AwStGDSn0anPBRm6s7roAcP4FISZLgvx4151wmjohRFoXPRze42rfq/N7tExuijxv90k fpArBYlj18KbgYXgfh8Ypa6vv4HMPUHZPxgasaeh2qoF6wR+njkHIqKR4E5EbQ== Date: Thu, 17 Aug 2023 15:14:16 +0200 (CEST) From: Erik Wienhold To: rob stone , "[Quipsy] Markus Karg" , "pgsql-general@lists.postgresql.org" Message-ID: <515898094.356558.1692278056903@office.mailbox.org> In-Reply-To: <4489a1c28b0d5733ff29332b168b1b62fa75994c.camel@tpg.com.au> References: <4489a1c28b0d5733ff29332b168b1b62fa75994c.camel@tpg.com.au> Subject: Re: Cast INTEGER to BIT confusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 17/08/2023 14:57 CEST rob stone wrote: > > It works thus:- > > postgres 15.4 =# CREATE TABLE T (c BIT); > CREATE TABLE > postgres 15.4 =# insert into T values (B'1'); > INSERT 0 1 > postgres 15.4 =# select * from t; > c > --- > 1 > (1 row) > > See section 9.6 in the doco. But Markus wrote that he cannot change the CREATE TABLE and INSERT statement. -- Erik