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 1hpDK3-0002uW-Qr for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 15:00:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hpDK2-0005qL-FB for pgsql-admin@arkaria.postgresql.org; Sun, 21 Jul 2019 15:00:22 +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 1hpDK2-0005qE-2s for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 15:00:22 +0000 Received: from sonic304-9.consmr.mail.bf2.yahoo.com ([74.6.128.32]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hpDJz-0003mC-2u for pgsql-admin@lists.postgresql.org; Sun, 21 Jul 2019 15:00:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1563721217; bh=amxciYHEvb2HYHP3gyM7ZXdj5OrqrhVuqRGg/5DLIIs=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=ScIJMxFqKdoys5JUCmBOJgRwmX4Rfy2Qde2skV7BuLsEPv+hAVF3BDGuEBS81VSkvCXP2RuZETa9+3f8dWbGdubeAdQfNNggfuVtGbuBHkS5Z0uMd7U8XRq6OosyX81Sbma11w85sBKyw+Gr1yRtGGXwmX9Lc3TtxGOWqesCd90u4YM2Nn1Hqi/6bloUUzJ3dmuhPR3YU9z0bkJIuVkHPZnYeS0TeKNZv3nVCisvA6xIASbZjSEgmbdsasBk81rRC0aKtHjhdWN7IhxjndYb1I//l+prrihiL0hJasO1RFtqDRRh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iz.1U2vpbxEtL1ZdJzxrwkO2gVkJXyHgB ZhNunRpi5WEC7vd6umJolryrhI_CBGMvD9D.leKxn9n9L41u_HYOP8VYc03tnOfrWOl_CBDXwp_e hp.1FTzdDHlWIpl5TZqOWp9l8YYWJvPhsGg7SBWJyKkniTTd9ZXsVBiukn844f4yjuVpoEVV8lit jvWvIyAWtscm9mYAhuG5lL.p9Da0ZChykSpnTRdoU.TMvQgnpWUn3jweemaSzaeYrUlo.h3q9VgW pysrNRGMVIDx_bcdPXsukkeryGJbpGMJCmPVCh8lp Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Sun, 21 Jul 2019 15:00:17 +0000 Date: Sun, 21 Jul 2019 15:00:13 +0000 (UTC) From: Karen Goh To: "David G. Johnston" Cc: pgsql-admin@lists.postgresql.org, Ron Message-ID: <905425626.2686338.1563721213121@mail.yahoo.com> In-Reply-To: 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> Subject: Re: How do I alter an existing column and add a foreign key which is a Primary key to a table? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2686337_1416343352.1563721213120" Content-Length: 1870 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_2686337_1416343352.1563721213120 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =20 On Sunday, July 21, 2019, 10:55:13 PM GMT+8, David G. Johnston wrote: On Sunday, July 21, 2019, Karen Goh wrote: You can't Select s_tutor.zip_code from subject_tutor as zip_code belongs t= o s_tutor table. Hence, I wrote my last message about my confusion. You need to show your entire schema and the queries that are giving you tro= uble if you want to get help that is less confusing. Though as I wrote befo= re I think your immediate problem is that you don=E2=80=99t have a =E2=80= =9Ctutor=E2=80=9D table on which to create the PK. Is there a way for me to generate an entity table diagram vis pgAdmin4 or P= SQL ? David J. =20 ------=_Part_2686337_1416343352.1563721213120 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable





On Sunday, July 21, 2019, 10:55:13= PM GMT+8, David G. Johnston <david.g.johnston@gmail.com> wrote:
<= br>
On Sunday, July 21, 2019, Karen Goh <karenworld@yahoo.com> wro= te:

You can't Select s_tutor.zip_code from subject_tutor as = zip_code belongs to s_tutor table.

Hence, I wrote my last messag= e about my confusion.



You need to show your entire schema an= d the queries that are giving you trouble if you want to get help that is l= ess confusing. Though as I wrote before I think your immediate problem is = that you don=E2=80=99t have a =E2=80=9Ctutor=E2=80=9D table on which to cre= ate the PK.

Is there a way for me to generate an entity table diagra= m vis pgAdmin4 or PSQL ?

David J.

= =20 ------=_Part_2686337_1416343352.1563721213120--