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 1vAaMU-003Wlv-Mk for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 20:50:42 +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 1vAaMT-00CTz9-Is for pgsql-general@arkaria.postgresql.org; Sun, 19 Oct 2025 20:50:40 +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 1vAaMS-00CTz1-Ok for pgsql-general@lists.postgresql.org; Sun, 19 Oct 2025 20:50:40 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vAaMO-0036dq-2u for pgsql-general@postgresql.org; Sun, 19 Oct 2025 20:50:39 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 5A7E2EC011D; Sun, 19 Oct 2025 16:50:34 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sun, 19 Oct 2025 16:50:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1760907034; x=1760993434; bh=1bkGWwL9rVngf9cX7VJ7GElZjJZ7Xmgfyi21Ozb+BJY=; b= PZPAhojlmdPnK3/Zjx5UtAf1XrjVs0vCSsjlVR7ng3aokTLxknRsOyzH5X5UloJg SJoDuQdxD04Jzd4JBc1iANwjfJRgtxO17rRYc4QuQJG3zQ7UvpBIkO2cPfdJ9oIW rXAFv++aaKtfNWH2AVIdpUJkD4LF48nxQKu+x5QW2sv+LKlTAICekgpIKVcTwZR5 C9PMyRuSak6EWtipROFCjJfYrHgJmc1BC0tM6bVzMjFXF23N/LjqLzWoC7VZjEhW oOhQNxXdU/uNkvc2S1nXS7ob787FJI040IbaYrRDT2leoNH9HOsdedhij1c8L98X ynl6sGUPmmtv5yoa7TE6Ww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1760907034; x=1760993434; bh=1 bkGWwL9rVngf9cX7VJ7GElZjJZ7Xmgfyi21Ozb+BJY=; b=ELpJZ1fpZsW1dRs+U 3/5ahWfpba7qzmri1St3PaplNAZt28vLW/8CLooMya/7P8e+56sPBCShQCXNHv1k /GPwzOMQaewgHQjVpnPXUW2WIL6A5bx6qHFaRGmWmQQZFWuIyS/JqJuVxqQcMFjQ mifwhiXeb7O2wQoN/dRfwJCvCVBGTOmG/A14NZMdnPtazD2BuNQ9nwwOF7/48G7n 3dH75swOEAkzSCfN0pLjnwD6G6Thz6lzO+ul7Yz1wv1Pec+I49jMcy12zMoM66JX oArEkSGX0zNBsboMZFlmXokVockyXAe3YZsgmhXBtNCNxX0MkLkz4T6HRCvXwI9x qN4GA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddufeehleegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomheptegurhhirghn ucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqe enucggtffrrghtthgvrhhnpeeivdfhieehheegueeileejieettdejhedugeefleekvdel keehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggp rhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehrshhhvghprg hrugesrghpphhlqdgvtghoshihshdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghn vghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 Oct 2025 16:50:33 -0400 (EDT) Message-ID: <57f94275-65ef-4e43-92e2-5fe3c7130e07@aklaver.com> Date: Sun, 19 Oct 2025 13:50:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Arrays vs separate tables To: Rich Shepard , pgsql-general@postgresql.org References: <162e5330-861c-ecc7-45c1-aaa1aff26c88@appl-ecosys.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <162e5330-861c-ecc7-45c1-aaa1aff26c88@appl-ecosys.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/19/25 13:43, Rich Shepard wrote: > In the former book I read that sometimes it's better to have multiple > values > for an atribute in a single row by creating a separate table for that > attribute rather than using the postgres array capability. The people table > in my database (1706 rows) has two attributes using the array type > (direct_phone and email), and only a few indivuals have multiple landline > phone numbers (cell_phone is a separate column) or email addresses (office > and personal?). Would it make sense for me to create new landline and email > address tables and replace the array contents? For direct_phone and email entries that have more then one value, how do you know what the values are pointing at e.g home vs office vs second office location, etc? > > Other than remembering to use curly braces {} when entering data into an > array column I don't think there'd be any performance benefit for making > the > change. I'm curious to learn about arrays vs separate tables. > > TIA, > > Rich > > -- Adrian Klaver adrian.klaver@aklaver.com