Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpFfr-0000XA-PT for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 17:31:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpFfq-0006Ja-DP for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 17:31:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hpFfq-0006JS-11 for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 17:31:02 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hpFfn-00050G-Ct for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 17:31:00 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id F06B221DEE; Sun, 21 Jul 2019 17:30:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo06-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo06-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G9jHWp1C2N77; Sun, 21 Jul 2019 17:30:57 +0000 (UTC) Received: from [192.168.2.16] (unknown [8.39.228.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id A492A21DEC; Sun, 21 Jul 2019 17:30:53 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: How do I alter an existing column and add a foreign key which is a Primary key to a table? From: Scott Ribe In-Reply-To: <1465046932.2664428.1563726642792@mail.yahoo.com> Date: Sun, 21 Jul 2019 11:30:52 -0600 Cc: Avin Kavish , Ron , pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <820008379.2579287.1563670685484@mail.yahoo.com> <5CE41E80-274A-44DA-9553-E2DCA260F751@jakobs.com> <385857992.2643116.1563717238725@mail.yahoo.com> <923fb3b1-90e9-e0b5-bc5b-d896128c3f28@gmail.com> <1745586001.2633224.1563719075867@mail.yahoo.com> <905425626.2686338.1563721213121@mail.yahoo.com> <2030754658.2646264.1563721831668@mail.yahoo.com> <75125c45-0fed-e5f1-50f0-9646db20dde6@gmail.com> <927283546.2681887.1563722628862@mail.yahoo.com> <1465046932.2664428.1563726642792@mail.yahoo.com> To: Karen Goh X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This forum is recommended for questions regarding administration of = PostgreSQL, which your questions are not related to. pgsql-gernal or = pgsql-sql would be better fits. But I'd strongly suggest that you pause and learn SQL basics in a = structured way. You've said several times that you've been writing = queries for a long time, but your questions here demontrate a serious = lack of understanding of the basics. My personal recommendation: https://www.postgresql.org/docs/11/tutorial-sql.html Or, for a quicker start:=20 https://www.postgresql.org/docs/11/tutorial-sql.html https://www.postgresql.org/docs/11/sql.html -- Scott Ribe scott_ribe@elevated-dev.com https://www.linkedin.com/in/scottribe/