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 1sotWe-00EbuJ-Ud for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 23:47:02 +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 1sotWe-003stx-M3 for pgsql-general@arkaria.postgresql.org; Thu, 12 Sep 2024 23:47:00 +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 1sotWd-003soh-0p for pgsql-general@lists.postgresql.org; Thu, 12 Sep 2024 23:47:00 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sotWY-000tUG-3Z for pgsql-general@postgresql.org; Thu, 12 Sep 2024 23:46:58 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.phl.internal (Postfix) with ESMTP id 99478138011A; Thu, 12 Sep 2024 19:46:52 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Thu, 12 Sep 2024 19:46:52 -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=fm3; t=1726184812; x=1726271212; bh=QiFqg6w6eAYpwphe56TbayViR6+YuHhaL/msJGGFY4E=; b= 8STjwkwdxsinnNWHzYlx4L1NkRd8UzOtYh4H9GKkwMlCcIKvJc4DWz6oQfN11f9E UaqQYmX7/0zj0RWgJyq8K6y1ADIDZfdTKJbq6w1AoPnsl1SZaQiYL/scMIKHqTE4 W2nVocbNgtKQ4E0HpEe6jZsN3OU0GSvSpUoOiO/MsViEm4vz0cGRDfoqsVQzjKD2 pQnop4DzWNdeg1uYATPeuQdtDNM0jiuUVxL3EwbjojUY/phw9CziN4GHQxmzXaX+ rMopn5o9HE5opTzqK+uFmDhFOnH+aifuYS5j7qOQw0NxladKdyRn0Qx7xQw6jUts 1gUNWaqVRJP0/OgvdtLOfw== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726184812; x= 1726271212; bh=QiFqg6w6eAYpwphe56TbayViR6+YuHhaL/msJGGFY4E=; b=A yxwhTTD2aSqqO7/riklaicRgAsBZ5T+LRq2ndsJ9wNenKMQBWBVP/M8q+Z49gVmA h0iJ65M4dEWCn+hk0GdqcrRpkVt6C4Flb511tU5wfB3Jsx8b2JHcMllGo31CvwJm DuxDuCCBNGb/AI3FqmAIUWF9iME8bD8SKzltS83dhqNxJVYd2x3f3xKNdTaakw/+ t/3gpwx4p57XLdywI5tD7dre+ScmeTMOJfXinoTBr5uZzDiEi+oRdOFCX/Y9KwrS BR0jSfPLlzoqWzYmF8hgsVyE4xYPdRtmhNyCupSUpgXwwKyxWQ1jb2yhIirk9+bN ZeUPF7XeUiZZUuHlcuUXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejgedgvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeeivdfhieehheegueeileej ieettdejhedugeefleekvdelkeehtdfgiefffeekudenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhl rghvvghrrdgtohhmpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehrshhhvghprghrugesrghpphhlqdgvtghoshihshdrtghomhdprhgtphht thhopehpghhsqhhlqdhgvghnvghrrghlsehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 19:46:51 -0400 (EDT) Message-ID: Date: Thu, 12 Sep 2024 16:46:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: DDL issue To: Rich Shepard , pgsql-general@postgresql.org References: <91bda8-3bdb-d93-6c17-41a03a3de27a@appl-ecosys.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: <91bda8-3bdb-d93-6c17-41a03a3de27a@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 9/12/24 16:01, Rich Shepard wrote: > I have one name in the people table who owns 5 different dairies with three > different phone numbers, but all 5 have the the same email address. > > The five dairies each has its own name and location while the people table > has five rows with the same last and first names and email address. > > Is there a way to have only one entry for the owner in the people table > while related to five different company names? In some industries, such as > dairy farms, this is not an unusual situation. Quick and dirty: people_table person_id PK name_last name_first email_address ph_number ... location_table loc_id PK person_id_fk FK <--> people_table(person_id) loc_name loc_st_addr loc_st_city loc_st_st_prov ... contact_table contact_id PK loc_id_fk FK <--> location_table(loc_id) contact_ph_number contact_email --Can be null It can get more involved then this, depends on how flexible you want to get. > > TIA, > > Rich > > > -- Adrian Klaver adrian.klaver@aklaver.com