public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Arrays vs separate tables
Date: Sun, 19 Oct 2025 13:50:32 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

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
[email protected]






view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Arrays vs separate tables
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox