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 1tVbvd-009z0M-G3 for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 19:41:21 +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 1tVbvc-005UtY-W4 for pgsql-general@arkaria.postgresql.org; Wed, 08 Jan 2025 19:41:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tVbvc-005Uso-Km for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 19:41:20 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tVbvZ-000abT-1J for pgsql-general@lists.postgresql.org; Wed, 08 Jan 2025 19:41:19 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-e46ebe19368so158564276.0 for ; Wed, 08 Jan 2025 11:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736365276; x=1736970076; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3cwGo/TwDET1xCHoTotEbwGS9+YsDpAEjGFbgOyTBIA=; b=ATrAzq8y8Q+tVG1Cgb3/wLNY/uG0jQyehl/6OCTXVIE4bfV826aaFdiVcuqldbUTCc 0xKbujBWeO38waq9ydzFt+0VQHLSnnTkVc1KFoeyK/Hm2wNHoXx+/HRuZZSGreelxtK7 Mylu7FnRU4mYZOlG1MobXYlI6UBTvyq3SqWAfrlHYPya9jaYJmaAZgIYsCIZUlWn14Zj kbzCntKySOASMqJGrhSgUpZjLM8wI9IVLMcQNL+zyoJrNK7XoZee0qqIwJ0QLOUNmMVH OsPlyw00tjTZs0kK550IQivVf4JKy6Dxw5OehpgDOtaqXozPLxbqlUu88nP+HGDNiLwx 1hPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736365276; x=1736970076; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3cwGo/TwDET1xCHoTotEbwGS9+YsDpAEjGFbgOyTBIA=; b=CiDRzlYat0dxx7axbLg9LOiqGh6pYOWayNUo/QwnzI1CUpi6TqYRkdzbQEcowu5WpA nA11CaxN5hm/GXNsf5rF2qmCVTsnZGIWwB9wOqTNkTtR6PiPsfimevEalQB2A/WPIFVu 4wXsI7yaAsetGV0MyamwLkSLmXBk0lUEsd5e+ymLQ1KeTLA4EDwhuQtDPLN6P75jQPG1 Td9E7mSS5yuxj3zGUYTAityI4g+qn9rd9oYjA1sINkGWLRV2iCJg5dDZtxxj78fBGRAM aFtqdWFH/BRMGJlUhkQmEgMx5Re8DDs9J8dZtkBwNItFbte/mjcjv7i8gxlEmIv8tSvv tUsg== X-Forwarded-Encrypted: i=1; AJvYcCW8IDjvx7G5JdRnO7VB5J6NSMReJ1HFWpCTrhRiZjkRW6gfu1GNaCtv2ov5sPA8biaEz5l9IIpQZ3FGfaLt@lists.postgresql.org X-Gm-Message-State: AOJu0Yzn1VELrhBeff9YUjdcC7LPEDVQznxGikfEz0GNvnQ1+SNDIu8k D2+rIzB6GiXUqWiWGbY9e76DYh2cJyJQQ6Bs3WQfNawbBK+XAf+U6+i0VgH8YzMYtcwSMwvGDx9 scrqmyM41s5bHtzAOD3MxqE7ItU8= X-Gm-Gg: ASbGncs7kpp1gDaNIU5mwtQYPGirsdBVWIOHrq4E7y85YnWj66zJ+WpjhsfBAQZ2NRo UI7pv49qpXPZG7lqTLgw1ybEki5W2EmcqaDL68pQHOFq1Xyt8r0b4vVKeefBmBN+2D7rqz9M= X-Google-Smtp-Source: AGHT+IG3BM1K2t3TzcHboPX/GJj1C3uDI7m6S4v+b0eX9WJhHKziVzM2x6Hb/7sB8zr4IN5CjO64UM7hqtgiq8+54H4= X-Received: by 2002:a05:690c:dc1:b0:6ef:e390:1d36 with SMTP id 00721157ae682-6f531226869mr4377547b3.12.1736365276177; Wed, 08 Jan 2025 11:41:16 -0800 (PST) MIME-Version: 1.0 References: <11AA76D0-CAFE-4A17-BCCF-50520CCDF47F@thebuild.com> <051EB6AC-2395-4EAD-B30C-069FBC01107F@thebuild.com> In-Reply-To: <051EB6AC-2395-4EAD-B30C-069FBC01107F@thebuild.com> From: Igor Korot Date: Wed, 8 Jan 2025 13:40:38 -0600 X-Gm-Features: AbW1kvYoQjmHeEnIGWB3mVWsn_w6EjQry_Q_V5JmcUZ1gsXP4feB0aYkLy4o6jQ Message-ID: Subject: Re: Postgres do not support tinyint? To: Christophe Pettus Cc: "David G. Johnston" , Ron Johnson , "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Christopphe, On Wed, Jan 8, 2025 at 1:34=E2=80=AFPM Christophe Pettus = wrote: > > > > > On Jan 8, 2025, at 11:30, Igor Korot wrote: > > There is no boolean - it is 0-4 inclusive. > > Unless you have somehow gotten PostgreSQL running on an IBM 7070, the ran= ge 0-4 can be represented by three binary digits, aka booleans. :-) The only booleans I know of are 0 and 1. ;-) > > To be serious, though, the situation is: > > 1. If there are just one or two tinyints, having a tinyint type wouldn't = save any space in the row. No it is not a lot of them. So then "smallint" is the best bet, right? Thank you > 2. If there are a lot of them, it's worth encoding them into a bitstring.